1、让group类型的tableView 顶部没有空白
self.fridensTable.tableHeaderView = UIView.init(frame: CGRect(x:0.0,y:0.0,width:self.fridensTable.bounds.size.width,height:0.01)
2、子类相对于超父类的位置。比如cell上的textFeild相对于self.view 的位置
CGRect temp = [textField convertRect:textField.bounds toView:self.view];
3、支付宝集成的好教程,依赖库照教程里的添加运行才不会报错
http://www.jianshu.com/p/941f2c83a458
4、UIButton内有两个控件titleLabel和imageView,imageview在左边,title在右边,所以写这样的界面的时候就不需要用一个imageview和一个button来显示
5、数据解析中遇到<null>和(null)的情况时:
<null> 用 isEqual:[NSNUll null] ,(null)用==nil 来判断
6、可用正则表达式捡取字符串中的某些字符,比如取字符串中的所有数字
NSRegularExpression *regular = [NSRegularExpression regularExpressionWithPattern:@"[a-zA-Z.-]" options:0 error:NULL];//表示取除了这些以外的其他字符
NSString *string = currentVerson;
NSString *result = [regular stringByReplacingMatchesInString:string options:0 range:NSMakeRange(0, [string length]) withTemplate:@""];//结果
7、时间转时间戳必须指定[formatter setDateFormat:@"YYYY-MM-dd HH:mm:ss"];
8、tableView选中后背景变灰的效果马上消失的方法是在didSelectRow方法里写[tableview deselectRowAtIndexPath]
9、让textFeild不顶左边编辑的方法是:
UIView *view = [[UIView alloc]initWithFrame:CGRectMake(0, 0, 15, 15)];
textFeild.leftView = view;
textFeild.leftViewMode = UITextFieldViewModeAlways;
view.userInteractionEnabled = NO;