objective c - How to fix the Table view as Dialog or Popup For all View Controllers in ios -
totally have 5 view controllers , have fixed 1 button account button in 5 view controllers, once clicked account button need show tablewview below image,first tried 1 table view show hide in first view controller want show table view 5 view controller when clicked account button,
this want show in view controllers,
when click option navigate
my account -> accountvc, track order -> trackordervc, customer services ->cusservicesvc
same thing implemented in 1 of project.create subclass of uiview , in .h file write 2 method
- (void)showmenuviewanimatedwithframe:(cgrect)rect; - (void)hidemenuviewanimated;
and in .m file create object of table view implement it's delegate , datasource method , write code as
- (void)showmenuviewanimatedwithframe:(cgrect)rect{ listtableview.frame = cgrectmake(0, 10, rect.size.width, rect.size.height - 10); [uiview animatewithduration:0.3f animations:^{ self.frame = rect; }]; } - (void)hidemenuviewanimated{ [uiview animatewithduration:0.3f animations:^{ self.frame = previewframe;//set view frame previewframe }]; }
finally call methods in view controller want show dropdown picker creating views object.if set correctly like:
Comments
Post a Comment