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.

shanet
  • 7,246
  • 3
  • 34
  • 46
debina
  • 15
  • 4

2 Answers2

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

Community
  • 1
  • 1
Ayush
  • 3,989
  • 1
  • 26
  • 34
  • i am facing one problem,whenever i am deleting a particular button,everytime the last button is getting deleted. – debina Oct 07 '13 at 09:27
0
- (void)actionSheet:(UIActionSheet *)actionSheet clickedButtonAtIndex:(NSInteger)buttonIndex   

using these actionsheet delegate method you can delete that programmaticlly created button for eg:

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

        [button removefromsuperview];

    }
}
Fogmeister
  • 76,236
  • 42
  • 207
  • 306
yhpets
  • 87
  • 1
  • 11