Skip to content

Instantly share code, notes, and snippets.

@HamGuy
Created August 13, 2013 06:27
Show Gist options
  • Save HamGuy/6218365 to your computer and use it in GitHub Desktop.
Save HamGuy/6218365 to your computer and use it in GitHub Desktop.
ios check
需要添加一张启动图片,大小:640*1136,添加后默认命名为Default-568h@2x.png。
图片适配,对于高清的1136图片,命名同样使用@2x,只是改名图片名称,如image-1-os5.png,image-1-os5@2x.png,
在代码中判断iphone5?(image-1):(image-1-os5),没有@22x这种。
#define iPhone5 ([UIScreen instancesRespondToSelector:@selector(currentMode)] ? CGSizeEqualToSize(CGSizeMake(640, 1136), [[UIScreen mainScreen] currentMode].size) : NO)
view.frame = CGRectMake(0, 0, 320, 416+(iphone5?88:0))
AViewController *aViewContrller = [[AViewController alloc] initWithNibName:(iPhone5?@"AViewController-5":@"AViewController") bundle:nil];
UIViewAutoresizingFlexibleTopMargin:与superView上边界保持动态距离(按比例)
UIViewAutoresizingFlexibleBottomMargin:与superView下边界保持动态距离(按比例)
UIViewAutoresizingFlexibleLeftMargin:与superView左边界保持动态距离(按比例)
UIViewAutoresizingFlexibleRightMargin:与superView右边界保持动态距离(按比例)
UIViewAutoresizingFlexibleWidth:与superView宽度成比例
UIViewAutoresizingFlexibleHeight:与superView高度成比例
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment