美文网首页
日常小干货

日常小干货

作者: Zz7777777 | 来源:发表于2017-05-19 11:08 被阅读37次

    仿照美团lable小圆角

    参考:传送门

    UILabel *tagLabel = [UILabel new];tagLabel.text= @"减";

    tagLabel.textColor = [UIColor whiteColor];tagLabel.font = [UIFont systemFontOfSize:12];tagLabel.layer.backgroundColor= [UIColor greenColor].CGColor;tagLabel.layer.cornerRadius =2;

    去掉导航栏下边的黑线

    [self.navigationController.navigationBar setBackgroundImage:[[UIImage alloc] init] forBarMetrics:UIBarMetricsDefault];

    self.navigationController.navigationBar.shadowImage= [[UIImage alloc]init];

    一个tableView延迟加载图片的思路

    这种实现利用NSDefaultRunLoopMode 在不干扰主线程的情况下 当cpu有空闲的时候去加载图片

    Masonry一些取巧的操作

    1.make.edges.equalTo(view2);edges:边缘(让2边的边缘都相等).

    2.make.centerY.mas_equalTo(self.distanceLabel);(可以理解为2个控件的中线水平对齐)

     model.FLDBID = [NSString stringWithFormat:@"clarence_%zd",index]; 使用%zd可以减少数据类型警告的问题

    相关文章

      网友评论

          本文标题:日常小干货

          本文链接:https://www.haomeiwen.com/subject/jxcyxxtx.html