【问题标题】:It's possible set different size a scroll for portrait and landscape orientation?可以为纵向和横向设置不同大小的滚动条吗?
【发布时间】:2014-08-07 02:58:00
【问题描述】:

可以为纵向和横向设置不同大小的卷轴吗? 示例:纵向:x500 y568 横向:x568 y320

首页.h

@interface 主页:UIViewController {

IBOutlet UIScrollView *ScrollerHome;

}

@结束

首页.m

  • (void)viewDidLoad { [超级viewDidLoad];

    //----------------------------------ScrollView Home--------- ------------------------------// [ScrollerHome setScrollEnabled:YES]; [ScrollerHome setContentSize:CGSizeMake(815, 610)];

    }

    @结束

【问题讨论】:

    标签: iphone xcode5 scrollview


    【解决方案1】:
    UIInterfaceOrientation orientation = [[UIApplication sharedApplication] statusBarOrientation];
    
    if (orientation == UIDeviceOrientationPortrait || orientation ==
     UIDeviceOrientationPortraitUpsideDown) 
    {
        //portrait        
        [ScrollerHome setContentSize:CGSizeMake(500, 568)];
     }
    else if (orientation == UIDeviceOrientationLandscapeLeft || orientation == UIDeviceOrientationLandscapeRight)
    {
        //landscape
        [ScrollerHome setContentSize:CGSizeMake(568, 320)];
    }
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2014-07-07
      • 1970-01-01
      • 2014-10-22
      • 1970-01-01
      • 1970-01-01
      • 2013-07-20
      相关资源
      最近更新 更多