UIButton文字位置显示
来源:互联网 发布:js分页代码 编辑:程序博客网 时间:2024/06/05 07:08
按钮的文字居右
UIButton *rightButton = [[UIButtonalloc] initWithFrame:CGRectMake(rightButtonX,0,rightButtonW , frame.size.height)];
//如果紧紧设置以下代码,不会生效
rightButton.titleLabel.textAlignment =NSTextAlignmentRight;
//需要加上这边这一行
rightButton.contentHorizontalAlignment =UIControlContentHorizontalAlignmentRight;
//如果不想让文字紧贴着边框,就加上下一行
rightButton.contentEdgeInsets = UIEdgeInsetsMake(0,0, 0, 10);
文字和图片的位置调换
CGRect rightButtonFrame = self.rightButton.frame;
self.rightButton.titleEdgeInsets =UIEdgeInsetsMake(0,0, 0,15);
self.rightButton.imageEdgeInsets =UIEdgeInsetsMake(0, rightButtonFrame.size.width -10, 0,0);
0 0
- UIButton文字位置显示
- UIButton的文字显示位置
- UIButton文字的显示位置
- UIButton文字的显示位置,字体的大小
- UIButton文字的显示位置,字体的大小
- 设置UIButton的文字显示位置、大小、颜色
- UIButton 文字换行显示
- UIButton图片文字位置调整
- UIButton文字居左显示
- UIButton文字居左显示
- UIButton文字居左显示
- UIButton文字居左显示
- UIButton文字居左显示
- 设置UIButton的文字显示位置、字体的大小、字体的颜色
- 设置UIButton的文字显示位置、字体的大小、字体的颜色
- 设置UIButton的文字显示位置、字体的大小、字体的颜色
- 设置UIButton的文字显示位置、字体的大小、字体的颜色
- 设置UIButton的文字显示位置、字体的大小、字体的颜色 .
- Mac OS X上使用XCode编译调用OS X的动态库
- 在Ubuntu下解决 adb devices :???????????? no permissions 方法
- 【JavaScript】JavaScript中的封装继承多态
- [leetcode] 200. Number of Islands
- C++primer学习:标准库特殊设施:正则表达式基础
- UIButton文字位置显示
- JS实现Office在线编辑和浏览(实用)
- 让字体变的更清晰CSS 中 -webkit-font-smoothing
- poj2479 Maximum sum(最大子段和变形)
- asp连接acess数据库出现 Microsoft JET Database Engine 错误 '80004005
- 如何生成验证码图片代码实现
- java.sql.SQLException: Access denied for user 'XXX'@'localhost' (using password: YES)
- 使用nginx 实现反向代理
- [Andriod官方API指南]连接之蓝牙