-
//location size状态栏高20,设置frame时需要让出20 view1.frame =CGRectMake(10, 20, 394, 706); //backgroundcolor view1.backgroundColor = [UIColor magentaColor]; //add view to 父view [self.view addSubview:view1]; /* 1.png 1@2x.png 1@3x.png 3GS 3.5inch 320*480 @1x 4/4s 3.5 320*480 @2x 640*960 5/5c/5s 320*568 @2x 640*1136 6 4.7 375*667 @2x 750*1344 6Plus 5.5 414*736 @3x 1242*2208 */ NSLog(@"w:%f h:%f",[[UIScreen mainScreen] bounds].size.width,[[UIScreen mainScreen] bounds].size.height); //frame NSLog(@"frame - x:%f y:%f w:%f h:%f",view1.frame.origin.x,view1.frame.origin.y,view1.frame.size.width,view1.frame.size.height); //bounds - 边框大小 x,y always zero NSLog(@"bounds - x:%f y:%f w:%f h:%f",view1.bounds.origin.x,view1.bounds.origin.y,view1.bounds.size.width,view1.bounds.size.height); //center point NSLog(@"center -x:%f y:%f ",view1.center.x,view1.center.y);查看全部
-
ViewController.m - (void)viewDidLoad { [super viewDidLoad]; // Do any additional setup after loading the view, typically from a nib. //view UIView *view1 =[[UIView alloc] init]; //location size状态栏高20,设置frame时需要让出20 view1.frame =CGRectMake(100, 100, 50, 50); //backgroundcolor view1.backgroundColor = [UIColor redColor]; //add view to 父view [self.view addSubview:view1]; /* 1.png 1@2x.png 1@3x.png 3GS 3.5inch 320*480 @1x 4/4s 3.5 320*480 @2x 640*960 5/5c/5s 320*568 @2x 640*1136 6 4.7 375*667 @2x 750*1344 6Plus 5.5 414*736 @3x 1242*2208 */ //现实当前设备的屏幕尺寸 NSLog(@"w:%f h:%f",[[UIScreen mainScreen] bounds].size.width,[[UIScreen mainScreen] bounds].size.height); }查看全部
-
设置频幕宽高查看全部
-
124查看全部
-
手机,单界面查看全部
-
状态栏高度20像素查看全部
-
虽然是单窗口,但是可以有多个window查看全部
-
手机是单窗口应用查看全部
-
ui视图查看全部
-
将所有的序列图放入数组中并且实例化查看全部
-
加载图片的方式查看全部
-
各型号图片尺寸查看全部
-
UI界面设计基础介绍查看全部
-
注释 #if 0<br> #endif查看全部
-
两种图片加载方式查看全部
举报
0/150
提交
取消