摘要: 改变UITextField placeHolder颜色、字体我们有时需要定制化UITextField对象的风格,可以添加许多不同的重写方法,来改变文本字段的显示行为。这些方法都会返回一个CGRect结构,制定了文本字段每个部件的边界范围,甚至修改placeHolder颜色,字体。– textRectForBounds: //重写来重置文字区域– drawTextInRect: //改变绘文字属性.重写时调用super可以按默认图形属性绘制,若自己完全重写绘制函数,就不用调用super了.– placeholderRectForBounds: //重写来重置占位符区域– draw... 阅读全文
posted @ 2014-03-31 11:56 bokeyuan_dan 阅读(231) 评论(0) 推荐(0) 编辑
摘要: Regular Expression MetacharactersCharacteroutsideof sets[inside sets]Description\a✓✓Match a BELL, \u0007\A✓Match at the beginning of the input. Differs from^in that\Awill not match after a new line within the input.\b✓Match if the current position is a word boundary. Boundaries occur at the transiti 阅读全文
posted @ 2014-03-31 11:54 bokeyuan_dan 阅读(263) 评论(0) 推荐(0) 编辑
摘要: 在objc项目中使用常量的最佳实践之前,在在objc项目中使用常量中,使用c的预处理#define来设置常量。比如,可以做个头文件,然后在需要的类文件中import,使用常量。但这不是最佳实践。这样做可能是最好的方式,首先在比如叫Constants.h的头文件中:#importextern NSString * const kInitURL;@interface Constants : NSObject {}@end这里使用到extern c关键字,表示这个变量已经声明,只是引用。const关键字表示变量是常量,不可修改。在objc的约定里,常量也是大小写混排的驼峰命名规则,首字母小写,另外, 阅读全文
posted @ 2014-03-31 10:11 bokeyuan_dan 阅读(128) 评论(0) 推荐(0) 编辑