iphone - Questions while using presentModalViewController -


in application, tried use function [self.navigationcotroller presentmodalviewcontroller:nextvc animated:yes]; however, when goes next view, subview fulfill whole screen(of course did) , question , how add bar button lead view back?

i have tried use

  1. self.navigationitem.leftbarbuttonitem = [[uibarbuttonitem alloc]initwithtitle:@"back" style:uibarbuttonitemstyledone target:self action:@selector(go)]; 

    in function viewdidload, did not work, there's no bar or button showed

  2. uinavigationbar *bb =  [[uinavigationbar alloc]initwithframe:cgrectmake(0, 0, [uiscreen mainscreen].bounds.size.width, 44)]; self.nvbar = bb; [self.view addsubview:bb]; 

however, have no idea how add barbutton new navigationbar ---nvbar

would give me solution?

you need pop new view controller in order navigation bar automatically included.

in view controller code above in,

//*** hook 4 buttons these actions , play around  //*** better sense of going on.     //*** jsbviewcontroller name of test class //*** should use viewcontroller class coding //*** can see difference of pop/push versus present/dismiss inside of             //*** navigation controller -(ibaction)push:(id)sender {   jsbviewcontroller * viewcontroller = [self.storyboard instantiateviewcontrollerwithidentifier:nsstringfromclass([jsbviewcontroller class])];   [self.navigationcontroller pushviewcontroller:viewcontroller animated:yes]; } -(ibaction)pop:(id)sender {   [self.navigationcontroller popviewcontrolleranimated:yes];  } -(ibaction)present:(id)sender {   jsbviewcontroller * viewcontroller = [self.storyboard instantiateviewcontrollerwithidentifier:nsstringfromclass([jsbviewcontroller class])];   [self presentviewcontroller:viewcontroller animated:yes completion:nil]; } -(ibaction)dismiss:(id)sender {   [self dismissviewcontrolleranimated:yes completion:nil]; } 

for behavior looking for, need use push method
[self.navigationcontroller pushviewcontroller:viewcontroller animated:yes];


Comments

Popular posts from this blog

SPSS keyboard combination alters encoding -

Add new record to the table by click on the button in Microsoft Access -

javascript - jQuery .height() return 0 when visible but non-0 when hidden -