您的位置:首页 > 移动开发 > IOS开发

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 添加的方法类似。
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: