Nsstring *str = yes ? @"hhh" : @"yyy";
一开始图片文件夹层次结构不对, 当你把图片拖进去,就对了, 一开始没有内容,所以位置不对
uitableview group模式顶部有个空白
// 时间日期蓝条
// 计算imageView长度
NSString *dotaLocationString = @"4/15日在呼伦贝尔";
CGFloat labelWidth = [dotaLocationString sizeWithFont:kFontWithSize(11) constrainedToSize:CGSizeMake(MAXFLOAT, 20)].width;
dateLocationImageView =[[UIImageView alloc]init];
[self.contentView addSubview:dateLocationImageView];
[dateLocationImageView mas_makeConstraints:^(MASConstraintMaker *make) {
make.right.mas_equalTo(0);
make.width.mas_equalTo(labelWidth + 16); // 132
make.height.mas_equalTo(20);
make.top.mas_equalTo(self.contentView).offset(12);
}];
UIImage * image = [UIImage imageNamed:@"推荐热度背景"];
UIEdgeInsets insets = UIEdgeInsetsMake(0, 10, 0, 0);
// 指定为拉伸模式,伸缩后重新赋值
image = [image resizableImageWithCapInsets:insets resizingMode:UIImageResizingModeStretch];
dateLocationImageView.image = image;
dataLocationLabel = [UILabel hdf_labelWithText:@"4/15日在呼伦贝尔" superView:dateLocationImageView constraints:^(MASConstraintMaker *make) {
make.left.mas_equalTo(8);
make.centerY.mas_equalTo(dateLocationImageView);
}];
dataLocationLabel.font = [UIFont systemFontOfSize:11];
dataLocationLabel.textColor = [UIColor whiteColor];
--------
降低约束优先级
价格被挤压了, 降低约束优先级,解决问题
// 价格label
priceLabel = [UILabel hdf_labelWithText:@"¥1000"
textColor:kAssistOrangeColor
font:kFontWithSize(12)
superView:self.contentView
constraints:^(MASConstraintMaker *make) {
make.right.mas_equalTo(preTimeLabel.mas_left).offset(1);
make.baseline.mas_equalTo(preTimeLabel);
}];
// 职称
doctorProfessionRank = [UILabel hdf_labelWithText:@"职称safdsafasfasfsadfasfsafaaf"
textColor:kColorWith16RGB(0x646464)
font:kFontWithSize(12)
superView:self.contentView constraints:^(MASConstraintMaker *make) {
make.left.equalTo(doctorName);
make.top.equalTo(doctorName.mas_bottom).offset(5);
make.right.equalTo(priceLabel.mas_left).offset(-15).priority(750);
}];
------
collectionView cell方法 不调用,因为collectionView的frame不对
// _collectionView = [[UICollectionView alloc]initWithFrame:self.collectionViewContainerView.bounds collectionViewLayout:self.flowLayout]; // bouns出不来
_collectionView = [[UICollectionView alloc]initWithFrame:CGRectMake(0, 0, SCREEN_W, self.collectionViewContainerView.width) collectionViewLayout:self.flowLayout]; // 这样能出来!!
------
view没有加载上来,因为下划线变量没有调用懒加载