拥有18年软件开发和IT教学经验。曾任多家上市公司技术总监、架构师、项目经理、高级软件工程师等职务。 网络人气名人讲师,...
[self.contentView mas_makeConstraints:^(MASConstraintMaker *make) { make.top.equalTo(@0); make.bottom.equalTo(@0); }];
Dynamicly calculate the string height when obtaining data, and set the parent control frame
Related methods: CGRect strRect = [str boundingRectWithSize:CGSizeMake(maxWidth, MAXFLOAT) options:NSStringDrawingUsesLineFragmentOrigin attributes:@{NSFontAttributeName : [UIFont systemFontOfSize: fontSize]} context:nil];
CGRect strRect = [str boundingRectWithSize:CGSizeMake(maxWidth, MAXFLOAT) options:NSStringDrawingUsesLineFragmentOrigin attributes:@{NSFontAttributeName : [UIFont systemFontOfSize: fontSize]} context:nil];
It’s okay if the height of the parent view is not given. The content will prop it upOf course, if it is a cell, you need to calculate it yourself
The bottom of the bottom view is equal to the bottom of the parent view
Dynamicly calculate the string height when obtaining data, and set the parent control frame
Related methods:
CGRect strRect = [str boundingRectWithSize:CGSizeMake(maxWidth, MAXFLOAT) options:NSStringDrawingUsesLineFragmentOrigin attributes:@{NSFontAttributeName : [UIFont systemFontOfSize: fontSize]} context:nil];
It’s okay if the height of the parent view is not given. The content will prop it up
Of course, if it is a cell, you need to calculate it yourself
The bottom of the bottom view is equal to the bottom of the parent view