UIButton左边图片右边文字的做法
2024-09-07 03:05:18
UIImage *yuyinImage = [UIImage imageNamed:@"yuyin.png"];
[soundButton setImage:yuyinImage forState:UIControlStateNormal];
[soundButton setImage:yuyinImage forState:UIControlStateSelected];
[soundButton setImage:yuyinImage forState:UIControlStateHighlighted];
//top left bottom right
[soundButton setImageEdgeInsets:UIEdgeInsetsMake(, , , )]; NSString *soundButtonTitle = @"语音";
[soundButton setTitle:soundButtonTitle forState:UIControlStateNormal];
[soundButton setTitle:soundButtonTitle forState:UIControlStateSelected];
[soundButton setTitle:soundButtonTitle forState:UIControlStateHighlighted];
[soundButton setTitleEdgeInsets:UIEdgeInsetsMake(, , , )]; [myButton setTitleEdgeInsets:UIEdgeInsetsMake(, , , )]; 4个参数是上边界,左边界,下边界,右边界。
最新文章
- 【Android测试】【第十六节】Instrumentation——初识+实战
- C++头文件的组织
- 再谈CocoaPods
- 原创 | 《地狱边境》登顶50国iOS下载榜,恐怖游戏或是独立开发者突破口(转)
- MySQL基本查询语句
- PHP错误Warning: Cannot modify header information - headers already sent by解决方法
- C++虚基类的作用
- ##DAY15——UICollectionView
- 5个可用提高Godaddy主机速度的第三方CDN加速服务商
- MSSQL 备份数据库还原
- 记一次用express手写博客
- ubuntu中利用qtcreator引用opencv249及采起采集卡的共享库
- .net正则IP加端口,并返回IP加端口
- google 身份验证器
- ExtJS 4.2 教程-03:使用Ext.define自定义类
- iOS开发-Certificates、Identifiers和Profiles详解
- [Selenium]如何实现上传本地文件
- Python环境右键定制
- Java基础(一):简介
- Python rpartition() 方法