tags:

views:

715

answers:

1

Can someone explain to me what the contentInset property in a UIScrollView instance is used for? And maybe provide an example?

thanks,

fbr

+3  A: 

It sets the distance between the content view and the enclosing scroll view. aScrollView.contentInset = UIEdgeInsetsMake(0, 0, 0, 7.0);

edit: er, distance of the inset, to be clear.

jball
is it used to add a padding to the UIScrollView then? If not could you give me a practical example. My problem is not how to implement it but when to implement it.
ForeignerBR
Yes, it pads the content on the inside of the scroll view. It's akin to the CSS `padding` property.
Marc W