IOS AlertView动态添加按钮
2014-02-11 11:47
309 查看
UIAlertView* genderAlert = [[UIAlertView alloc] initWithTitle:@"颜色" message:nil delegate:self cancelButtonTitle:nil otherButtonTitles:nil, nil];
if (_productColorArray) {
for (int i = 0; i < _productColorArray.count; i++) {
NSString* str = [_productColorArray objectAtIndex:i];
if ( ![str isEqual:[NSNull null]] && str.length != 0) {
[genderAlert addButtonWithTitle:str];
}
}
}
[genderAlert addButtonWithTitle:@"取消"];
genderAlert.cancelButtonIndex = genderAlert.numberOfButtons-1;
[genderAlert show];
return;
UIActionSheet 添加的方法类似。
if (_productColorArray) {
for (int i = 0; i < _productColorArray.count; i++) {
NSString* str = [_productColorArray objectAtIndex:i];
if ( ![str isEqual:[NSNull null]] && str.length != 0) {
[genderAlert addButtonWithTitle:str];
}
}
}
[genderAlert addButtonWithTitle:@"取消"];
genderAlert.cancelButtonIndex = genderAlert.numberOfButtons-1;
[genderAlert show];
return;
UIActionSheet 添加的方法类似。
相关文章推荐
- iOS学习之动态添加Button和监听UIAlertView按钮
- iOS学习之动态添加Button和监听UIAlertView按钮
- iOS学习基础学习之动态添加Button和监听UIAlertView按钮
- iOS学习之动态添加Button和监听UIAlertView按钮
- IOS学习之动态添加Button和监听UIAlertView按钮
- IOS学习之动态添加Button和监听UIAlertView按钮
- IOS7下,alertView不能使用addSubview添加textField解决办法
- iOS开发UI基础—13在UIImageView中添加按钮以及Tag的参数说明
- iOS中动态密码(倒计时按钮)按钮Block封装,选取器(UIPickerView)的Block封装,日期选取器(UIDatePicker)的Block封装
- 在iOS虚拟键盘上添加动态隐藏按钮
- iOS UITableView的Section Footer添加按钮
- IOS UITableView 底部添加按钮
- iOS 在tableView上添加button导致按钮没有点击效果和不能滑动的问题
- ios开发UI篇—在ImageView中添加按钮以及Tag的参数说明
- iOS 在imageview中添加按钮 并能响应消息 响应者链条
- iOS中AlertView添加输入框
- 在iOS虚拟键盘上添加动态隐藏按钮
- iOS 导航条上添加UISegmentedControl,点击分类按钮,显示不同的ViewController
- ios 动态添加了按钮,绑定同一个点击事件,如何判断点击的是哪个?
- iOS 动态添加按钮