最近用Xcode6开发遇到一个莫名其妙的bug,Xcode6以前重来没遇见过,苹果原生的UIScreen获取屏幕大小不对,我用iPhone5的模拟器,获取到的屏幕大小尽然是320x480,显示出的效果呢就是上下分别一条黑带,控制器的View以480高度显示在中间,原因呢是项目设置中的Launch I...
分类:
其他好文 时间:
2014-11-30 06:11:28
阅读次数:
519
// 创建一个和屏幕大小相同的window,记住[UIScreen mainScreen].bounds 是获取当前屏幕大小 self.window = [[[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]] autorel....
分类:
其他好文 时间:
2014-11-29 13:09:19
阅读次数:
179
CGRect frame = [[UIScreen mainScreen] applicationFrame];//获取窗口大小 UIView *theView = [[UIView alloc] initWithFrame:frame];//实例一个UIView theView.backgr...
分类:
其他好文 时间:
2014-11-27 21:53:44
阅读次数:
115
1、得到当前屏幕的尺寸:
CGRect rect_screen = [[UIScreenmainScreen]bounds];
CGSize size_screen = rect_screen.size;
2、获得scale:
CGFloat scale_screen = [UIScreen mainScreen].scale;
...
分类:
移动开发 时间:
2014-11-27 10:43:56
阅读次数:
175
- (void)viewDidLoad{ [super viewDidLoad]; UIScrollView *scrollview=[[UIScrollView alloc] initWithFrame:[UIScreen mainScreen].bounds]; scrollview.c...
分类:
其他好文 时间:
2014-11-23 00:34:53
阅读次数:
164
AppDelegate: self.window = UIWindow(frame: UIScreen.mainScreen().bounds) self.window!.backgroundColor = UIColor.whiteColor() self...
分类:
移动开发 时间:
2014-11-19 15:24:47
阅读次数:
207
iOS的SDK中提供了UIDevice,NSBundle,NSLocale,UIScreen等类来获取设备、app等相应的信息。UIDevice用于获取设备相应的信息,如设备名称、设备唯一标识、系统名称、系统版本号、设备模式、本地设备模式等。NSBundle用于获取App相应的信息,如应用名称、应用...
分类:
移动开发 时间:
2014-11-17 15:24:44
阅读次数:
234
//@mg:masksToBounds必须为NO否者阴影没有效果// cell.layer.masksToBounds = NO; cell.layer.contentsScale = [UIScreen mainScreen].scale; cell.layer.shadowOpacity...
分类:
其他好文 时间:
2014-11-12 16:20:50
阅读次数:
160
CGRect frame = [[UIScreen mainScreen] bounds];NSLog(@"frame :%@",frame);这样输入是nullNSLog(@"frame :%f",frame.size.width);这样有值[[UIScreen mainScreen] bound...
分类:
移动开发 时间:
2014-11-08 10:21:02
阅读次数:
176
最近才开始写IOS程序,然后发现要学的东西真的很多,而且真的在实战中才能收获颇丰。frame : iphone 6 plus var x:CGFloat = 10 var y:CGFloat = 64 var xWidth:CGFloat = UIScreen.main...
分类:
移动开发 时间:
2014-10-26 22:33:18
阅读次数:
266