zoukankan      html  css  js  c++  java
  • iOS masonry设置控件的优先级

    1.效果  标题标题标题  时间;优先保证时间的完整显示,标题过长就显示...

    //时间
            _timeLabel = [[UILabel alloc] init];
            [self.contentView addSubview:_timeLabel];
            _timeLabel.font = [UIFont systemFontOfSize:12];
            _timeLabel.textAlignment = NSTextAlignmentRight;
            _timeLabel.textColor = UIColorFromRGB(0x999999);
            [_timeLabel mas_makeConstraints:^(MASConstraintMaker *make) {
                make.right.equalTo(weakSelf.contentView.mas_right).offset(-11);
                make.top.equalTo(weakSelf.topClearView.mas_top).offset(16);
            }];
            
            //标题
            _titleLabel = [[UILabel alloc] init];
            [self.contentView addSubview:_titleLabel];
            _titleLabel.numberOfLines = 1;
            _titleLabel.font = [UIFont systemFontOfSize:16];
            _titleLabel.textAlignment = NSTextAlignmentLeft;
            _titleLabel.textColor = UIColorFromRGB(0x111111);
            _titleLabel.lineBreakMode = NSLineBreakByTruncatingTail;
            [_titleLabel mas_makeConstraints:^(MASConstraintMaker *make) {
                make.left.equalTo(weakSelf.manyChooseButton.mas_right).offset(26);
                make.top.equalTo(weakSelf.topClearView.mas_top).offset(16);
                make.right.mas_lessThanOrEqualTo(self.timeLabel.mas_left).with.offset(-5);
            }];
            [self.titleLabel setContentCompressionResistancePriority:(UILayoutPriorityDefaultLow) forAxis:(UILayoutConstraintAxisHorizontal)];
            [self.timeLabel setContentCompressionResistancePriority:(UILayoutPriorityDefaultHigh) forAxis:(UILayoutConstraintAxisHorizontal)];
  • 相关阅读:
    基因组注释
    GapCloser
    Endnote参考文献格式修改
    多行变单行
    AD的基因组【转载】
    ROC曲线
    自我觉察-4:觉察“不浪费食物”和“胃过饱食”的信念
    自我觉察6-我的价值感?
    表观遗传、开放染色质测序、ATAC-seq、ChIP-seq简介
    ADNI(Alzheimer`s disease neuroimaging initiative)介绍
  • 原文地址:https://www.cnblogs.com/qiyiyifan/p/8310229.html
Copyright © 2011-2022 走看看