How to change page width on UIScrollView?
When my uiscrollview with paging enabled gets rotated, it works fine, but it still thinks the images are the same width, so the pa开发者_JAVA百科ges don't take up the full page. so can i tell it the "pages" are now as wide as the height?
You can enable autoresizing subviews for the UIScrollView
, like for any other view. Of course, you need to set appropriate autoresizing masks for each of your subviews. This will take care of resizing, repositioning, etc. However, the contentSize property isn't automatically adjusted, so you need to take care of that yourself, for example in layoutSubviews
. I've done all of this before, it's a little fiddly, but doable as a subclass of the scroll view. I've actually publicly released this autoresizing scroll view, but it's commercially licensed, and I'm not sure what SO policy is on that kind of thing, so I won't link to it.
精彩评论