文鹏教育

博客园 首页 新随笔 联系 订阅 管理

2015年6月18日 #

摘要: -substringToIndex: 从字符串的开头一直截取到指定的位置,但不包括该位置的字符(这点与java不同)NSString *string1 = @"This is a string"; NSString *string2 = [string1 substringToIndex:3]; /... 阅读全文
posted @ 2015-06-18 18:37 zhoup 阅读(241) 评论(0) 推荐(0)

摘要: 后面经过测试,如果button的文字长度变更,会导致图片位置变化,经过多次修改UIEdgeInsets的值也没有达到期望效果,最终采用集成UIButton类,重写layoutSubviews函数实现,特将成果记录一下,以便后续查阅123456789101112131415161718-(void)l... 阅读全文
posted @ 2015-06-18 16:03 zhoup 阅读(313) 评论(0) 推荐(0)

摘要: 1)创建UIButton *btn1 = [UIButton buttonWithType:UIButtonTypeRoundedRect]; 风格有如下typedef enum { UIButtonTypeCustom = 0, // 自定义,无风格 UIButtonTypeRoun... 阅读全文
posted @ 2015-06-18 15:38 zhoup 阅读(219) 评论(0) 推荐(0)

摘要: UITextField *text = [[UITextField alloc]initWithFrame:CGRectMake(20, 20, 130, 30)]; //初始化textfield并设置位置及大小 text.borderStyle = UITextBorderStyleRounded... 阅读全文
posted @ 2015-06-18 15:37 zhoup 阅读(186) 评论(0) 推荐(0)

摘要: 1、创建CGRect rect = CGRectMake(100, 200, 50, 50);UILabel *label = [[UILabel alloc] initWithFrame:rect];2、text //设置和读取文本内容,默认为nillabel.text = @”文本信息”; //... 阅读全文
posted @ 2015-06-18 14:11 zhoup 阅读(178) 评论(0) 推荐(0)