ilhnctn
ilhnctn

Reputation: 2210

After rotation strange behaviour with UIScrollView

I have an iPad application and in one of my views i use UIScrollView and UIPageControl together to navigate between views array. when my simulator is on Portrait mode there is no problem but when i rotate it to Landscape just down side of the scrollview appears and i can see just about 30 per 100 of the whole view. How can i fix this situation can anyone help?

EDIT : I dynamically add some buttons-subviews on the subview that i have added to Scrollview, can some one give any idea about how to detect the orientation of the device and decide the frames. I need something like the pseudo below:

    if(device_orientation == landscape){
       subButton.frame=....;
       textfield.frame=...;
}
    else{
       subButton.frame=....;
       textfield.frame=...;}
    } 

i tried but i got black screen..

EDIT-2 I used Interface builder for some views and there are some dynamically created views.I played a little with Autoresizing properties on the .xib file and now it looks perfect but the dynamic ones(they are all objects of a subclass of UIButton) dont response to any code(resizing, bacground color-photo ect..)

Upvotes: 4

Views: 663

Answers (1)

Simon Withington
Simon Withington

Reputation: 1485

Are you using interface builder or creating your view programmatically? It would be helpful if you could post some more of your source or some screenshots so that we can see a bit more clearly what's going on. As a stab in the dark, you might want to try setting the 'autoresizingMask' property of the views which you want to resize to '~UIViewAutoresizingNone' (not-none/flexible). If you can provide some more details, I'll try to help you some more :)

Upvotes: 1

Related Questions