1 iOS开发中使用Masonry让cell自适应高度
https://www.jianshu.com/p/9563f5b646d9
IB_DESIGNABLE
#import “MyTableViewCell.h”
//#import “Masonry.h”
@implementation MyTableViewCell {
UILabel *_contentLabel;
UILabel *newLabel;
UIButton *nnnnBtn;
MASConstraint *_masHeight;
}
-
(instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier {
self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
if (self) {
[self initSubView];
}
return self;
} -
(void)initSubView {
_contentLabel = [[UILabel alloc] init];
_contentLabel.backgroundColor = [UIColor orangeColor];
_contentLabel.textColor = [UIColor purpleColor];
_contentLabel.numberOfLines = 0;
_contentLabel.font = FONT(15);
[self.contentView addSubview:_contentLabel];// 布局
[_contentLabel mas_updateConstraints:^(MASConstraintMaker *make) {
// _masHeight = make.height.lessThanOrEqualTo(@50);
make.left.equalTo(_contentLabel.superview.mas_left).with.offset(20);
make.top.equalTo(_contentLabel.superview.mas_top).with.offset(20);
make.right.equalTo(_contentLabel.superview.mas_right).with.offset(-20);
// make.bottom.equalTo(_contentLabel.superview.mas_bottom).with.offset(-20);
}];newLabel = [[UILabel alloc] init];
newLabel.backgroundColor = [UIColor redColor];
newLabel.textColor = [UIColor purpleColor];
newLabel.numberOfLines = 0;
newLabel.font = FONT(11);
[self.contentView addSubview:newLabel];// 布局
[newLabel mas_updateConstraints:^(MASConstraintMaker *make) {
// _masHeight = make.height.lessThanOrEqualTo(@50);
make.left.equalTo(newLabel.superview.mas_left).with.offset(20);
make.top.equalTo(_contentLabel.mas_bottom).with.offset(20);
make.right.equalTo(newLabel.superview.mas_right).with.offset(-20);
make.bottom.equalTo(newLabel.superview.mas_bottom).with.offset(-20);
}];
}
-
(void)setContent:(NSString *)content{
_content = content;
_contentLabel.text = content;
newLabel.text = content;
} -
(void)setModel:(MyTableModel *)model {
_model = model;
_contentLabel.text = model.content;
newLabel.text = model.content;
}
2 iOS—Masonry的使用
https://blog.csdn.net/iotjin/article/details/80390272
3 cocoaPods 错误
Git常见错误整理
http://www.jouypub.com/2018/5c7e0c63ddcb804e73119965dda8c4a6/
id_rsa.pub如何查看
(使用cd命令进入id_rsa.pub目录,再使用more id_rsa.pub命令查看公钥的内容)