swift uibutton 图片在右, 文字在左

btn.semanticContentAttribute = .forceRightToLeft

查了下资料 

semanticContentAttribute 是反转 ,即描述视图的内容,用来确定视图之间切换时应翻转从左到右和从右到左的布局

最低支持到9.0



参考链接:https://www.jianshu.com/p/c4a6b236e8e3

 

猜你喜欢

转载自www.cnblogs.com/qingzZ/p/13384142.html