質問

Hierarchy is a fullscreen landscape container UIScroll. Inside are multiple fullscreen pages made up of uiscrollviews with images inside - this allows paging plus pinching /zooming of the inner scrollviews. You can scroll up and down.

I want to resize the width of the container scrollview and have the nested uiscrolls and images within them resize proportionally and dynamically to the new width and height.

My outer scroll has autoresize to yes, my inner scrolls have the same. And I also have my uiimageviews on auto as well.

Right now the frame of the container scroll just crops off the inner content.

Any thoughts?

役に立ちましたか?

解決

I ended up adding code to a function that allowed me to scale the interior of the scrollview the way I wanted.

 [containerscrollView setFrame:CGRectMake(200.0f, 0.0f, 800.0f, 768.0f)];
                         containerscrollView.contentSize = CGSizeMake(800,containerscrollView.frame.size.height * scrollArrayCount);
                         for (UIScrollView *tmp in [containerscrollView subviews]) {
                             if (tmp.tag>4000) // make sure to only resize the inner scrollview {
                                 [tmp setFrame:CGRectMake(tmp.frame.origin.x, tmp.frame.origin.y, 800.0f, 768.0f)];
                                 _innerScrollView.contentSize =CGSizeMake(800.0f, 768.0f);
                             }
                         }
ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top