iOS 任意布局UIButton中的图片与文字
来源:互联网 发布:阿里云华北2 编辑:程序博客网 时间:2024/06/15 20:44
- (void)setup{ self.titleLabel.textAlignment = NSTextAlignmentCenter;}- (instancetype)initWithFrame:(CGRect)frame{ if (self = [super initWithFrame:frame]) { [self setup]; } return self;}- (void)layoutSubviews{ [super layoutSubviews]; // 调整图片 self.imageView.width = 20; self.imageView.height = self.imageView.width; self.imageView.x = (self.width - self.imageView.width) / 2; self.imageView.y = (self.height - self.imageView.width) / 2 - 10; // 调整文字 self.titleLabel.x = 0; self.titleLabel.y = self.imageView.bottom + 5; self.titleLabel.width = self.width; self.titleLabel.textAlignment = NSTextAlignmentCenter; self.titleLabel.height = 20;}
阅读全文
0 0
- iOS 任意布局UIButton中的图片与文字
- iOS UIButton 图片和文字布局调整
- 一句代码搞定 UIButton 的图片与文字布局
- iOS 按钮文字图片任意布局,随意定制
- iOS UIButton调整图片与文字的位置
- iOS 搞定UIButton的文本与图片的布局
- IOS-UIButton的文本与图片的布局
- iOS UIButton 设置图片文字垂直排列
- ios UIButton 文字左边,图片右边排列
- ios UIButton的图片和文字位置
- iOS UIButton 设置图片文字垂直排列
- iOS UIButton 图片和文字上下居中
- UIButton的文本与图片的布局
- [IOS笔记]改变UIButton中图片和文字的位置 xib与故事版的差别
- UINavigationController添加文字与UIButton添加文字图片
- uibutton 图片加文字
- UIButton 文字图片排列
- 自定义 UIButton(图片+文字)
- linux生成随机密码
- php调试技巧
- 单反相机之初见倾心
- 微信蓝牙BLE接入调试指引 测试公众号篇(根据别人调试通过,做下记录)
- Languages CSU-ACM2017暑期训练1-Debug与STL
- iOS 任意布局UIButton中的图片与文字
- AJAX 封装
- Java字符串与文件的互转
- Linux内核混杂设备
- eclipse操作svn
- java正则表达式引起死循环导致程序卡主
- Git初始化步骤
- Python scikit-learn 模块svc方法的参数解释
- Hibernate中List<String>怎么处理