标签:
判断设备的状态
UIApplication* app = [UIApplication sharedApplication];
// 判断设备方向状态,做响应的操作
if(app.statusBarOrientation == UIInterfaceOrientationPortrait || app.statusBarOrientation == UIInterfaceOrientationPortraitUpsideDown){
}else if(app.statusBarOrientation == UIInterfaceOrientationLandscapeLeft || app.statusBarOrientation == UIInterfaceOrientationLandscapeRight){
}
设备状态,分以下几种:
以iPhone或者iPad的Home按钮为参照:
UIInterfaceOrientationPortrait---------按钮在下
UIInterfaceOrientationPortraitUpsideDown---------按钮在上
UIInterfaceOrientationLandscapeLeft---------按钮在左
UIInterfaceOrientationLandscapeRight---------按钮在右
程序中,根据的方向不同做不同的操作!
标签:
原文地址:http://www.cnblogs.com/vshiron/p/5093039.html