更改UIActionSheet按钮颜色
来源:互联网 发布:数据有效性 日期 编辑:程序博客网 时间:2024/05/24 06:01
使用如下方法定义UIActionSheet,其中颜色按钮的颜色为红色。
UIActionSheet *ActionSheet = [[UIActionSheet alloc] initWithTitle:@" "
delegate:selfcancelButtonTitle:@"删除"
destructiveButtonTitle:@"颜色"
otherButtonTitles:@"Done",nil];
[ActionSheet setActionSheetStyle:UIActionSheetStyleDefault];
1、修改颜色按钮的颜色为默认的蓝色的方法
UIActionSheet *sheet = [[UIActionSheet alloc] initWithTitle:@"" delegate:self
cancelButtonTitle:nil
destructiveButtonTitle:nil
otherButtonTitles:nil];
[sheet addButtonWithTitle:@"颜色"];
[sheet addButtonWithTitle:@"删除"];
sheet.cancelButtonIndex = sheet.numberOfButtons-1;
2、修改按钮的颜色为其他颜色的方法
实现代理方法
- (void)willPresentActionSheet:(UIActionSheet *)actionSheet
{
for (UIView *subViwein actionSheet.subviews) {
if ([subViwe isKindOfClass:[UIButtonclass]]) {
UIButton *button = (UIButton*)subViwe;
[buttonsetTitleColor:[UIColorblueColor]
forState:UIControlStateNormal];
}
}
}
- 更改UIActionSheet按钮颜色
- iOS 设置UIActionSheet 按钮颜色
- AlertDialog更改按钮颜色
- UIActionSheet,UIPickerView,修改navi的back按钮颜色
- UISearchBar 按钮的文字和颜色更改
- UIActionSheet修改文字颜色
- UIActionSheet 字体颜色设置
- 定制UIActionSheet中的按钮
- UIActionSheet动态添加按钮
- 动态添加UIActionSheet按钮
- 动态添加UIActionSheet按钮
- UIActionSheet弹窗按钮
- MFC工程更改按钮背景颜色,编辑框背景颜色,给按钮加载图片
- 更改UISearchBar 的背景色、取消按钮颜色
- ios给按钮图片根据不同的主题更改颜色
- iOS 更改tabbar字体颜色 自定义controller返回按钮
- UIActionsheet 的取消按钮问题
- UIActionSheet cancel 按钮响应不灵敏
- Struts2返回json的几种方式
- 房地产微信营销方案微信“危”与“机”
- 微星 x370 笔记本 摄像头的按键
- easyui tree插件扩展
- 现在公开一个DHT网络爬虫网络爬虫供大家一起交流
- 更改UIActionSheet按钮颜色
- oracle常用函数之STDDEV、STDDEV_POP、STDDEV_SAMP区别
- powerdesigner的破解
- MSP430按键控制串口发送数据
- svn 项目部署
- 35岁前务必成功的12级跳 --每天读一遍
- 现在公开一个DHT网络爬虫网络爬虫供大家一起交流
- SIM908 AT command 返回“no carrier"
- jni中的日志输出到LOGCAT