4
A
回答
7
提供的didRotateFromInterfaceOrientation
方法和中心的所有子视图的实现。
- (void)didRotateFromInterfaceOrientation:(UIInterfaceOrientation)fromInterfaceOrientation {
for(UIView *subview in [self.view subviews]) {
subview.center = self.view.center;
}
}
0
您应该为横向和纵向模式更改programmatic-ally内容的框架。 你可以试试这个为:
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {
if(interfaceOrientation == UIInterfaceOrientationLandscapeLeft || interfaceOrientation == UIInterfaceOrientationLandscapeRight){
// set contents' frame for landscape
}
else {
// set contents' frame for portrait
}
return YES;
}
相关问题
- 1. iOS - UIView的中心内容
- 2. 对齐UILabel以UIView为中心
- 3. 容器UIView对齐到底部
- 4. UIView的AirPrint内容
- 5. 对齐中心css内容
- 6. 对齐UIView的子视图
- 7. UIView中心,帧
- 8. UIView UITableViewController的中心
- 9. JavaFX:对齐FlowPane中的所有内容
- 10. 缩放UIView及其中的所有内容
- 11. UIView内的UIView没有显示
- 12. 对齐的UIView从屏幕中间
- 13. 滚动的UIView其内容
- 14. UIView的内容错位
- 15. UIView中心X UIImageView
- 16. 从UIView中删除所有对象
- 17. 强制对齐中心的内容
- 18. 中心对齐李的内容ul
- 19. JTable内容是中心对齐的
- 20. 将TableLayout的内容与中心对齐
- 21. 抓住UIView内容重绘
- 22. 如何剪切UIView内容?
- 23. 自动缩放UIView和旋转的所有内容
- 24. UIView的旋转中心
- 25. CGAffineTransform获取UIView的中心
- 26. 内容没有在一个UIView
- 27. 问题与中心对齐内容
- 28. 如何将内容与中心对齐
- 29. 获取内容对齐中心
- 30. 将网站内容对齐到中心
你使用nib文件还是以编程方式添加它? – shannoga 2010-12-21 05:35:06
我为此使用了nib文件。我知道这里有对齐属性,但通过设置这个我仍然面临同样的问题,在旋转后。 – 2010-12-21 05:49:23