1 UIGraphicsBeginImageContext(self.view.bounds.size);// 设置上下文2 3 [self.view.layer renderInContext:UIGraphicsGetCurrentContext()];4 5 UIImage *image=UI...
分类:
移动开发 时间:
2014-07-10 11:01:17
阅读次数:
199
(原文出自:http://www.cnblogs.com/wendingding/p/3770052.html,特别感谢)一:[[UIScreen mainScreen] bounds] 和[UIScreen mainScreen] applicationFrame]的区别:bounds就是屏幕的全...
曾经有人这么说过,在iphone里你看到的,摸到的,都是UIView,所以UIView在iphone开发里具有非常重要的作用。那么UIView我们到底知道多少呢。请看看下面的问题,如果这些你都知道,那么本文章的内容就请绕道,如果你还不太清楚,我想看了下面的内容,你就明白了。1。bounds和fram...
分类:
其他好文 时间:
2014-07-07 21:15:19
阅读次数:
305
上节说了没有营养的变量和常量,这玩意,都差不多,自己稍微看下就好了
Integers 整型
整数就是整数了,没有小数,整数有符号(+,-,0)或者无符号(0,+)
Swift提供了8,16,32,64位的有符号和无符号的整数,命名使用C的方式,比如,8位无符号的整型UInt8,32位有符号的整型就是Int32
Integer Bounds 整型范围
...
分类:
其他好文 时间:
2014-06-27 08:05:12
阅读次数:
272
CGRect screenBounds = [ [UIScreen mainScreen]bounds];//返回的是带有状态栏的Rect NSLog(@"%@", NSStringFromCGRect(screenBounds)); CGRect viewBounds = [ [U...
分类:
其他好文 时间:
2014-06-26 21:12:57
阅读次数:
173
frame:表示控件的位置和尺寸(以父控件的左上角为坐标原点(0,0))可以调整控件的大小和位置1 CGRect frame = _btn.frame;2 frame.origin.y -= 50;3 _btn.frame = frame;center:表示控件的中点(以父控件的左上角为坐标原点)可...
分类:
其他好文 时间:
2014-06-26 15:04:54
阅读次数:
189
// 安全释放
#define RELEASE_SAFELY(__Pointer) do{[__Pointer release],__Pointer = nil;} while(0)
// 屏幕的物理高度
#define ScreenHeight [UIScreen mainScreen].bounds.size.height
// 屏幕的物理宽度
#define ScreenWidth...
分类:
其他好文 时间:
2014-06-25 19:58:31
阅读次数:
197
程序支持横竖屏首先要搞懂这个方法什么时候走! 不用测试了,当Frame发生改变的时候,这个方法就走了。那 你想当程序由竖屏变成横屏的时候上面的控件 保持在原来的地方。首先你要搞懂bounds 这个属性。然后控件写成相对的位置让后你重写viewWillLayoutSubViews这个方法。当让你要是用...
分类:
其他好文 时间:
2014-06-25 14:46:38
阅读次数:
255
今天在进行代码检查的时候出现下面的异常:1 type parameters of T cannot be determined; no unique maximal instance exists for type variable T with upper bounds int,java.lang...
分类:
编程语言 时间:
2014-06-23 08:05:13
阅读次数:
381
button.png,尺寸为:24x60现在我们把它用作为按钮背景,按钮尺寸是150x50:// 得到view的尺寸CGSize viewSize = self.view.bounds.size;// 初始化按钮UIButton *button = [[UIButton alloc] init];/...
分类:
移动开发 时间:
2014-06-17 23:34:41
阅读次数:
337