欢迎访问 生活随笔!

生活随笔

当前位置: 首页 >

iOS--SDAutolayout宽度自适应

发布时间:2025/7/25 64 豆豆
生活随笔 收集整理的这篇文章主要介绍了 iOS--SDAutolayout宽度自适应 小编觉得挺不错的,现在分享给大家,帮大家做个参考.
#pragma mark - UIScrollView 内容竖向自适应、内容横向自适应方法@interface UIScrollView (SDAutoContentSize)/** 设置scrollview内容竖向自适应 */ - (void)setupAutoContentSizeWithBottomView:(UIView *)bottomView bottomMargin:(CGFloat)bottomMargin;/** 设置scrollview内容横向自适应 */ - (void)setupAutoContentSizeWithRightView:(UIView *)rightView rightMargin:(CGFloat)rightMargin;@end#pragma mark - UILabel 开启富文本布局、设置单行文本label宽度自适应、 设置label最多可以显示的行数@interface UILabel (SDLabelAutoResize)/** 是否是attributedString */ @property (nonatomic) BOOL isAttributedContent;/** 设置单行文本label宽度自适应 */ - (void)setSingleLineAutoResizeWithMaxWidth:(CGFloat)maxWidth;/** 设置label最多可以显示多少行,如果传0则显示所有行文字 */ - (void)setMaxNumberOfLinesToShow:(NSInteger)lineCount;@end

 

转载于:https://www.cnblogs.com/mafeng/p/5859522.html

总结

以上是生活随笔为你收集整理的iOS--SDAutolayout宽度自适应的全部内容,希望文章能够帮你解决所遇到的问题。

如果觉得生活随笔网站内容还不错,欢迎将生活随笔推荐给好友。