//CGRectInset 将原来的矩形放大或者缩小,正表示缩小,-表示放大。CGRect rect= CGRectMake(20, 50, 100, 80); CGRect rect1=CGRectInset(rect, -10, 20); NSLog(@"%@",p(rect1));//输出结....
分类:
其他好文 时间:
2014-11-22 20:07:57
阅读次数:
176
退回输入键盘
- (BOOL)textFieldShouldReturn:(id)textField{
[textField resignFirstResponder];
}
CGRect
CGRect frame = CGRectMake (origin.x,origin.y, size.width, size.height);矩形
NSStringFrom...
分类:
移动开发 时间:
2014-11-21 23:24:03
阅读次数:
476
(void) setSubView:(UIView *)masterView subCCGRect:(CGRect)subCCGRect imageName:(NSString *)imageName indexVaule :(NSInteger) indexVaule { UIImageV...
分类:
移动开发 时间:
2014-11-17 00:24:29
阅读次数:
176
和你意料的一样, 只需重写layoutSubviews 1 - (void)layoutSubviews 2 { 3 [super layoutSubviews]; 4 5 // 3个基本控件都往左移动10 6 7 CGRect textLabelF = self.text...
分类:
其他好文 时间:
2014-11-15 18:46:25
阅读次数:
132
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect
{
CGContextRef contex...
分类:
移动开发 时间:
2014-11-13 09:24:05
阅读次数:
350
-(id)initWithFrame:(CGRect)frame{ self=[super initWithFrame:frame]; if (self) { //使用self. 表示调用了set方法 retain了一次 self.lineArray=[NSMutableArray ...
分类:
移动开发 时间:
2014-11-11 20:45:26
阅读次数:
163
笔者还在照着别人代码敲东西的阶段 == 汗颜哪言归正传, 今天敲代码的时候发现只要是继承NSObject的类 都不能使用CGRect CGFloat ;会报:Unknown type name 'CGRect'; did you mean 'Rect'?纠结了一下午---在网友的帮助下才发现是XCo...
分类:
其他好文 时间:
2014-11-09 21:59:48
阅读次数:
272
CGRect frame = [[UIScreen mainScreen] bounds];NSLog(@"frame :%@",frame);这样输入是nullNSLog(@"frame :%f",frame.size.width);这样有值[[UIScreen mainScreen] bound...
分类:
移动开发 时间:
2014-11-08 10:21:02
阅读次数:
176
原因:在Xcode6前,创建的文件系统会自动为用户导入Foundation.h和UIKit.h文件,但是最新的Xcode6只为用户导入了Foundation.h文件,缺少一个。
所以,解决方案是:自己在头文件部分导入即可。...
分类:
移动开发 时间:
2014-10-28 09:24:28
阅读次数:
223
frame:类型是CGRect @property (nonatomic) CGRect frame; 控件所在矩形框的位置和尺寸(以父控件的左上角为坐标原点)bounds @property (nonatomic) CGRect bounds; 控件所在矩形框的位置和尺寸(以自己左上角为坐...
分类:
其他好文 时间:
2014-10-28 00:16:59
阅读次数:
293