iOS开发~iPad开发注意事项

Ipad开发和iPhone开发唯一的不同,就是屏幕大小的问题。如果不涉及旋转的话,就很简单。但是涉及到旋转,就很麻烦了。下面罗列了一些我的总结。

等有空了,在继续总结。

 

ipad导航知识

1.http://code4app.com/ios/%E9%AB%98%E4%BB%BFiPad%E7%89%88QQ%E7%A9%BA%E9%97%B4/522f2ccb6803fa2f5e000000

2.http://code4app.com/ios/Stacked-View/4f955e1406f6e71374000000

3.http://code4app.com/ios/Image-Sidebar-View/4fabbd7506f6e72d4a000000

4.http://code4app.com/ios/Stack-ScrollView/4fcf05896803fa9330000001

 

1.ios文档中说iPad默认情况下启动是垂直放置的

2.IOS5 父视图会吃掉子视图的事件

 

1.屏幕旋转的问题

http://blog.csdn.net/H_O_W_E/article/details/8896080(写的生动)

http://blog.csdn.net/linkai5696/article/details/6249564

 

#pragma mark - iPad屏幕旋转时候,设置控件的判断方法

 

- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation{

    

return YES;

}

 

- (void)willRotateToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation duration:(NSTimeInterval)duration{

    

    //先判断是否有效转向

    if( UIDeviceOrientationIsValidInterfaceOrientation( toInterfaceOrientation ) )

    {

        //参数表示是否横屏,这里我只需要知道屏幕方向就可以提前知道目标区域了!

        [self setCtrlPos: UIInterfaceOrientationIsLandscape( toInterfaceOrientation) ];

    }

}

 

//这个用来实现窗口空间大小位置调整

-(void)setCtrlPos:(BOOL)isHorz{

    

    CGRect rcClient = [[Tool shareToolObj] getClientRect:isHorz];

    

    //NSLog(@"CGRect : %@",NSStringFromCGRect(rcClient));

    

    //其他控件根据这个rcClient来调整位置大小

    

    if (isHorz) {

    

        //横屏布局

        [self setHorzFrame:rcClient];

        

    }else{

    

        //竖屏布局

        [self setVerFrame:rcClient];

    }

}

原文地址:https://www.cnblogs.com/kevingod/p/3878064.html