uiview - Set width of UINavigationController loaded from storyboard -
i'm using ecslidingviewcontroller ipad app, i'm trying uinavigationcontroller master page (menu) revealed under left side of main uiviewcontroller.
to uinavigationcontroller needs specific width otherwise goes full width isn't desired.
i'm using storyboards , load viewcontrollers this:
- (void)viewdidload { [super viewdidload]; // setup view controllers self.topviewcontroller = [self.storyboard instantiateviewcontrollerwithidentifier:@"maintop"]; self.underleftviewcontroller = [self.storyboard instantiateviewcontrollerwithidentifier:@"menu"]; } how can restrict width of 320px? know have set frame, it's , how.
ok quite easy once had thought it. made sure menu viewcontroller embeddedin uinavigationcontroller in storyboard. removed storyboardid menu vc , added uinavigationcontroller.
then subclassed uinavigationcontroller , added following viewdidload method:
- (void)viewdidload { [super viewdidload]; [self.slidingviewcontroller setanchorrightrevealamount:320.0f]; self.slidingviewcontroller.underleftwidthlayout = ecfixedrevealwidth; } removing code original menu vc viewdidload method. reading doc's ecslidingviewcontroller adding ecfixedreveal size vc match setanchorrightrevealamount value.
now have navigation controller within revealed left menu.
Comments
Post a Comment