iOS UIButton实现上显示图片,下显示文字
2016-06-07 18:38
531 查看
自定义类继承UIButton,然后 -(void)layoutSubviews { [super layoutSubviews]; CGFloat midX = self.frame.size.width / 2; CGFloat midY = self.frame.size.height/ 2 ; self.titleLabel.center = CGPointMake(midX, midY + 15); self.imageView.center = CGPointMake(midX, midY - 10); }
相关文章推荐
- HDU 1242 Rescue (BFS+优先队列)
- 3D角色遮挡住UI的实现,关于Stencil Buffer,描边,以及其他
- 11572 - Unique Snowflakes
- easyUI combox 省市县3级联动
- Android逆向分析之dex2jar和jd-gui使用
- assigned , native , identity 区别-Field 'id' doesn't have a default value问题解决方法
- gap锁 对于unique index 和Ununique index
- gap锁 对于unique index 和Ununique index
- gap锁 对于unique index 和Ununique index
- 解题报告:UVA_11235 Frequent Values RMQ_ST + 游程编码
- java.lang.String StringBuffer StringBuilder
- SwipeRefreshLayout.setRefresh(true)指示器不显示
- UGUI 按钮On Click事件
- UIImageView的contentMode
- 解决PKIX:unable to find valid certification path to requested target 的问题
- druid常见问题(官网解答)
- JDBC连接池、监控组件 Druid
- javaGUI设计简单计算器实验报告
- UIButton 字体颜色 粗体
- 关于String和StringBuilder、StringBuffer的区别?