设置setImageEdgeInsets和setTitleEdgeInsets是常规方法,
还有一种特殊的方法
_titleButton.semanticContentAttribute =UISemanticContentAttributeForceRightToLeft;
就简单的设置一个属性就可以做到,如果希望文字和图标之间有间距就直接在文字后边添加空格直到调
到你想要的距离
设置setImageEdgeInsets和setTitleEdgeInsets是常规方法,
还有一种特殊的方法
_titleButton.semanticContentAttribute =UISemanticContentAttributeForceRightToLeft;
就简单的设置一个属性就可以做到,如果希望文字和图标之间有间距就直接在文字后边添加空格直到调
到你想要的距离
本文标题:2020-07-24 iOS 一行代码搞定button 图文左右
本文链接:https://www.haomeiwen.com/subject/xrtslktx.html
网友评论