开发过程中遇到的知识点

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;

 

转载于:https://www.cnblogs.com/xiaonizicome/p/6442385.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值