对Button上image 和 title 位置进行设置
来源:互联网 发布:联通软件下载 编辑:程序博客网 时间:2024/06/05 08:44
UIButton *bt = [UIButtonbuttonWithType:UIButtonTypeCustom];
bt.frame = CGRectMake(100,100, 100,30);
bt.backgroundColor = [UIColorredColor];
[bt setImage:[UIImageimageNamed:@"1"]forState:(UIControlStateNormal)];
[bt setTitle:@"123"forState:(UIControlStateNormal)];
[bt setImageEdgeInsets:(UIEdgeInsetsMake(0,50, 0,0))];
[bt setTitleEdgeInsets:(UIEdgeInsetsMake(0, -100,0, 0))];
[self.viewaddSubview:bt];
本来 左边显示image 右边显示title 加上EdgeInsets约束 image显示在右边 title显示在左边
//设置image在button上的位置(上top,左left,下bottom,右right)这里可以写负值,对左写-5,那么image就象左移动5个像素
0 0
- 对Button上image 和 title 位置进行设置
- button中image和title的位置
- UIButton 的 image 和title 位置设置
- 更改button里面的Image和Title的位置
- button中title和image的相对位置
- button上的image和title的显示
- UIButton上image和title的位置调整
- UIButton将title和image放置在任意位置上
- UIButton通过UIEdgeInsetsMake设置image和title的位置
- 调整button上title的位置
- IOS button按钮中添加image和title并修改其位置
- iOS-随心所欲控制button内image view和title view的位置
- Button调整按钮中title和image的位置(包含工具类)ios
- 设置UIButton的image title 位置
- button 修改 title 和 image偏移量
- ios代码调整button图片image文字title位置
- ios代码调整button图片image文字title位置
- ios代码调整button图片image文字title位置
- struts2实现国际化
- 高手速成android开源项目【View篇】
- BZOJ1019: [SHOI2008]汉诺塔
- 昂贵的聘礼--floyd
- iOS学习笔记
- 对Button上image 和 title 位置进行设置
- MVC,MVP 和 MVVM 的图示
- Cocos2dx C++与Lua合并开发的VS配置环境搭建
- DecimalFormat类的使用
- 【数据结构与算法】有序数组二分法查找
- The Zen of Python
- android studio找不到Subversion
- 平滑效果
- Git入门(10)-添加远程仓库