【问题标题】:Iphone--(BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientationIphone--(BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
【发布时间】:2011-04-22 20:51:29
【问题描述】:

I 通过使用此命令 -(BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation

我可以自动旋转我的视图,有什么方法可以旋转和调整并适合屏幕。

提前致谢, (深)

【问题讨论】:

    标签: iphone


    【解决方案1】:

    您可以使用视图的自动调整大小属性来调整它们的大小以适应屏幕。

    例如,如果您希望视图水平和垂直调整大小,您可以使用:

    myView.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight;
    

    要控制视图是否会自动调整其子视图的大小,请使用布尔值 autoresizesSubviews 属性。

    要控制容器视图在容器视图大小发生变化时如何布局其子视图,请使用contentMode 属性。

    有关详细信息,请参阅 Apple 的UIView Class Reference

    【讨论】:

      猜你喜欢
      • 2012-09-13
      • 1970-01-01
      • 2011-02-10
      • 2011-03-25
      • 2011-01-11
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多