ios - Place floating UIButton on top of UICollectionView -
i'm desperately trying place uibutton on top of uicollectionview. goal check-in button new foursquare app.
my code looks so:
uibutton *floatingbutton = [[uibutton alloc] init]; [floatingbutton setframe:cgrectmake(320, 150, 50, 50)]; [floatingbutton setbackgroundcolor:[uicolor blackcolor]]; [self.collectionview addsubview:floatingbutton]; [self.collectionview bringsubviewtofront:floatingbutton];
the problem button isn't anywhere.
you want add button collectionview's parent view. self.view, hard sure without seeing more code.
instead of
[self.collectionview addsubview:floatingbutton];
you want
[self.view addsubview:floatingbutton];
Comments
Post a Comment