1
votes

In my app I am loading a view controller in a scrollview.The scrollview has a navigation bar. For this reason the view controllers loading on it shows double navigation bar with it's own. How to prevent it?

enter image description here

If i hide scrollview's navigation bar then the top position remain's blank.Can i fit view controller's navigation bar in place of scrollview navigation bar??

enter image description here

Always welcome for any kind of help.

2
try to start you scroll view position from top of the view.Bhavin_m
I tried to resize my view controller after removing the scrollview navigation controller from superView,as i need to make ViewController full screen. CGRect cgRect; cgRect.origin.x=0; cgRect.origin.y=0; cgRect.size.height=460; cgRect.size.width=320; self.view.frame= cgRect; [self loadView]; still same.top position is blank!Sofeda
how are you loading the view controller into scroll view?Rakesh
if (controller.view.superview == nil) { CGRect frame = self.scrollView.frame; frame.origin.x = frame.size.width * page; frame.origin.y = 0; controller.view.frame = frame; [self.scrollView addSubview:controller.view]; work like this to add view controller in scrollViewSofeda

2 Answers

0
votes

Hide Your RootviewController navigation bar and increase contentoffset of scrollview as per your requirement.

0
votes
[ViewController.navigationController setNavigationBarHidden:YES animated:YES];