UIButton上的图片和文字位置调整
2014-11-08 21:44
399 查看
UIButton上的图片和文字位置调整:
属性: imageEdgeInsets
contentEdgeInsets
UIEdgeInsetsMake
Creates an edge inset for a button or view.
UIEdgeInsets UIEdgeInsetsMake (
CGFloat top,
CGFloat left,
CGFloat bottom,
CGFloat right
);
Parameters
top
The inset at the top of an object. 距离顶部的间隔
left
The inset on the left of an object 距离左边的间隔
bottom
The inset on the bottom of an object. 距离底部的间隔
right
The inset on the right of an object. 距离右边的间隔
注:
图片设置左边距改变横向位置,文字设置右边距改变横向位置
[Btn setImageEdgeInsets:UIEdgeInsetsMake(0,
90,
0, 0)];
[Btn setTitleEdgeInsets:UIEdgeInsetsMake(0,
0, 0,
40)];
属性: imageEdgeInsets
contentEdgeInsets
UIEdgeInsetsMake
Creates an edge inset for a button or view.
UIEdgeInsets UIEdgeInsetsMake (
CGFloat top,
CGFloat left,
CGFloat bottom,
CGFloat right
);
Parameters
top
The inset at the top of an object. 距离顶部的间隔
left
The inset on the left of an object 距离左边的间隔
bottom
The inset on the bottom of an object. 距离底部的间隔
right
The inset on the right of an object. 距离右边的间隔
注:
图片设置左边距改变横向位置,文字设置右边距改变横向位置
[Btn setImageEdgeInsets:UIEdgeInsetsMake(0,
90,
0, 0)];
[Btn setTitleEdgeInsets:UIEdgeInsetsMake(0,
0, 0,
40)];
相关文章推荐
- UIButton上图片和文字的位置调整
- UIButton图片与文字位置调整
- UIButton图片文字位置调整
- UIButton的图片和文字相对位置调整
- iOS -- UIButton上的文字、图片位置的调整
- iOS - UIButton图片文字各种位置的调整
- UIButton上图片和文字的位置调整
- UIButton上的图片和文字位置调整
- UIButton的图片和文字相对位置调整
- UIButton上图片和文字的位置调整
- UIButton上的图片和文字位置调整
- duilib进阶教程 -- 图片和文字的位置调整 (5)
- ios代码调整button图片image文字title位置
- UIButton的UIEdgeInsets功能:设置button上的文字和图片的位置
- ios代码调整button图片image文字title位置
- 如何调整UIButton里面的文字位置以及按钮文字右对齐
- 调整UIButton上图片的位置和大小
- UIButton中图片与文字的位置设置
- uibutton 改变文字和图片的位置
- duilib进阶教程 -- 图片和文字的位置调整 (5)