0

I want the following. I have a navigation bar at the bottom of my app. Above I have a scrollview where the user can scroll to. Look at the image below.

enter image description here

Inside my scrollview I've added an image. This is what I do in code.

[scrollView setContentSize:(CGSizeMake(1024, 1400))];
[scrollView setScrollEnabled:YES];
[imgWebsite setFrame:CGRectMake(0, 0, imgWebsite.frame.size.width, 1400)];

Problem

My scrollview comes over my navigation bar at the bottom and so it is not visible. How do I solve this?

Steaphann
  • 2,797
  • 6
  • 50
  • 109

2 Answers2

0

Are you setting the frame of your scrollView as well as the contentSize?

Try something like this:

[scrollView setFrame:CGRectMake(0, 0, scrollView.frame.size.width, scrollView.frame.size.height - navBar.frame.size.height)];
Steph Sharp
  • 11,462
  • 5
  • 44
  • 81
0

You should minus navigation's bar height from your scrollview's height and that is 44(Default). I think it works.

Apple
  • 736
  • 1
  • 6
  • 24