判断是否为设备是否为ipad
#define IS_IPAD() ([[UIDevice currentDevice] respondsToSelector:@selector(userInterfaceIdiom)] && \
[[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPad)
#define INTERFACE_IS_PAD ([[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPad)
#define INTERFACE_IS_PHONE ([[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPhone)
判断屏幕摆放方式
if (UIInterfaceOrientationIsLandscape(orientation)) {
width = bounds.size.height;
height = bounds.size.width;
}
self.interfaceOrientation 获得
转屏会触发的方法
-(void)willRotateToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation duration:(NSTimeInterval)duration
{
[super willRotateToInterfaceOrientation:toInterfaceOrientation duration:duration];
//转屏时使页面视图的位置改变
[self centerButtonForInterfaceOrientation:toInterfaceOrientation];
}