0

I have an image view,on that there are programmatically created UIButtons. I want to delete these buttons through an UIActionSheet. is this possible in an iPad? Please help me out.

4

2 回答 2

0

Unfortunately there is no way to set a destructive button as a UIButton,unless you create a custom button with a red gradient background image like THIS

You can create a red button like the method specified above or like THIS

于 2013-10-07T05:49:04.410 回答
0
- (void)actionSheet:(UIActionSheet *)actionSheet clickedButtonAtIndex:(NSInteger)buttonIndex   

使用这些操作表委托方法,您可以删除以编程方式创建的按钮,例如:

- (void)actionSheet:(UIActionSheet *)actionSheet clickedButtonAtIndex:(NSInteger)buttonIndex 
{
    switch(buttonIndex)
    {
        case 0:

        [button removefromsuperview];

    }
}
于 2013-10-07T07:10:04.793 回答