objective c - Why the view doesn't show when I click the button in IOS? -
i new ios , , want implement album collectionview in ios.
when click filebrowserbutton button in first view , change second view(name:aitcameracollectionbrowser).
there has 2 button , collectionview in aitcameracollectionbrowser following picture.

and code of it's header file following code.
#import <uikit/uikit.h> @interface aitcameracollectionbrowser : uiviewcontroller <uicollectionviewdelegate, uicollectionviewdatasource> @property (strong, nonatomic) iboutlet uibutton *backbutton; @property (strong, nonatomic) iboutlet uibutton *localalbumbutton; @property (strong, nonatomic) iboutlet uicollectionview *collectionview; @end i have not load picture phone yet , should show view above picture when click change view button in first view.
the code of filebrowserbutton button following.
- (ibaction)filebrowserbutton:(id)sender { uiviewcontroller *viewcontroller = nil ; viewcontroller = [[aitcameracollectionbrowser alloc] initwithnibname:@"aitcameracollectionbrowser" bundle:nil] ; viewcontroller.edgesforextendedlayout = uirectedgenone; self.navigationitem.backbarbuttonitem = [[uibarbuttonitem alloc] initwithtitle:nslocalizedstring(@"back", nil) style: uibarbuttonitemstylebordered target:nil action:nil] ; [self.navigationcontroller pushviewcontroller:viewcontroller animated:yes]; } the above code of button in first view no problem.
but doesn't show when click filebrowserbutton button , has backbarbuttonitem on top of screen.
so problem @ second view , , don't know why button , collectionview not show ?
in you're header, or .h file, add following code
- (ibaction)filebrowserbutton:(id)sender; next, in you're xib or storyboard file, have connect filebrowserbutton you're file's owner (by right-clicking yellow, transparent box on left of you're first picture) button, , choose touch inside.
Comments
Post a Comment