iOS中按钮边框及文字对齐设置
来源:互联网 发布:广东裤哥战哭淘宝女郎 编辑:程序博客网 时间:2024/06/18 01:33
- (void)viewDidLoad {
[superviewDidLoad];
// Do any additional setup after loading the view, typically from a nib.
//创建UIButton
UIButton *button1 = [UIButtonbuttonWithType:UIButtonTypeRoundedRect];
button1.frame = CGRectMake(10, 30, 300, 30);
[button1 setTitle:@"圆角按钮"forState:UIControlStateNormal];
// 这句无效
// button1.titleLabel.textAlignment = NSTextAlignmentLeft;
button1.titleLabel.backgroundColor = [UIColorgrayColor];
button1.contentHorizontalAlignment =UIControlContentHorizontalAlignmentLeft;
button1.titleEdgeInsets = UIEdgeInsetsMake(0, 10, 0, 0);
[button1.layersetBorderColor:[UIColorgrayColor].CGColor];
[button1.layer setBorderWidth:1];
[button1.layer setCornerRadius:5.0f];
[button1.layer setMasksToBounds:YES];
[self.viewaddSubview:button1];
}
- iOS中按钮边框及文字对齐设置
- iOS -- 设置按钮中的文字左对齐
- iOS 按钮文字左对齐
- VC中工具栏按钮文字及左右排列设置方法
- IOS开发:UIAlertView设置文字左对齐
- xamarin.ios中设置button的边框及样式
- iOS-设置导航栏透明及字体、左右按钮、边框颜色
- xib中设置按钮的边框颜色
- UIButton - 设置图片及文字、文字左对齐
- iOS中关于设置UIButton文字和图标对齐格式的问题
- 中文字,文本框,button按钮垂直居中对齐方法
- 中文字,文本框,button按钮垂直居中对齐方法
- iOS - UIButton设置圆角和边框及边框颜色
- iOS --修改button文字位置大小 以及设置button边框
- 设置文字两端对齐
- 设置按钮圆角边框颜色及粗细
- QT按钮背景颜色设置及文字显示位置设置
- iOS 在视图中调整按钮距离边框的位置
- java 编程笔记
- redis-linux 安装配置以及使用手册
- rpmdb open failed 的解决办法
- 随手记----Android仿iOS音量调节的效果
- 《基于MFC的OpenGL编程》Part 9 Texture Mapping
- iOS中按钮边框及文字对齐设置
- 最近邻居法KNN
- PropertyPlaceholderConfigurer的用法
- java.lang.RuntimeException: Canvas: trying to use a recycled bitmap android.graphics.Bitmap@412d723
- python queue
- 类的static成员变量和成员函数
- redis的安装与一些基础操作
- Windows使用TightVNC客户端远程连接Mac
- 【技术】【使用】AFNetworking的介绍和应用