vishnu
vishnu

Reputation: 715

UIScrollView decrease bottom height

I want to decrease the bottom height of UIScrollView. For more details click on this link scrollview image

in that image red color box is extra space. dashly image is another view. My scroller runs between Apple and Dashly view. When i move that scroller content size bottom shows more height. I done this through storyboard. Added constraints also.

//_scrollViewOutlet.contentSize = CGSizeMake(320, 650);
_scrollViewOutlet.contentInset = UIEdgeInsetsMake(0, 0, -7, 0);

i tried the above two lines but it is not worked. Thanks in advance.

Upvotes: 1

Views: 61

Answers (2)

vishnu
vishnu

Reputation: 715

_scrollViewOutlet.contentInset = UIEdgeInsetsMake(0, 0, -100, 0);

It works fine for me.

Upvotes: 1

Reedy
Reedy

Reputation: 2076

The issue you have is that the scrollview thinks it has a larger content size than it does. You need to set the content size of the scrollview, calculate this correctly and set it, then it will work fine. Dont hack it, by adjusting the insets.

Upvotes: 0

Related Questions