开发者

UIView added with incorrect orientation

开发者 https://www.devze.com 2022-12-27 09:34 出处:网络
So I have been working on a problem with UIView on the iPad.Essentially I have a splitview as the root view and I want to overlay my custom image view over top 开发者_JAVA技巧of the splitview (This is

So I have been working on a problem with UIView on the iPad. Essentially I have a splitview as the root view and I want to overlay my custom image view over top 开发者_JAVA技巧of the splitview (This is because the splitview must be the root view). The problem that I have, is when I call addSubview on my splitview the subview gets displayed in its default orientation, with no regard to the iPad's current orientation. Any suggestions on what I am doing wrong or flag I am not setting?

Thanks!

Code that I am using to add the view:

[splitViewController.view addSubview: myImageController.view];

Example screenshots: http://www.engineering.uiowa.edu/~krtaylor/so/


So if figured out a solution and that is to programmatically create the view and use UIDevice's currentOrientation to size the view properly.


I had the same problem, seams resolved by removing from the parent view the "autoresize subview" option in IB.
Select the view a then: Inspector -> Attributes (first tab) -> drawing.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号