HOW TO REMOVE REDDESTRUCTIVE BUTTON FROM UIACTIONSHEET IN IOS

Betty Thomas

Total Post:5

Points:35
Posted by  Betty Thomas
 592  View(s)
Ratings:
Rate this:

I have created an application using UIActionSheet that pops up on the screen.

But I don't need to have destructive button on our action sheet. If I will try to remove the destructive button from the code then I get an error: No visible interface for UIActionSheet.


So, how can I remove the red destructive button from the action sheet.!

  1. Tarun Kumar

    Post:214

    Points:1642
    Re: How to remove RedDestructive Button from UIActionSheet in iOS

    Yes, you can remove destructive button from action sheet: 

    in the parameter of action sheet method 'initWithTitle:' pass nil in the destructiveButtonTitle parameter.
    For example:

    UIActionSheet *actionSheet = [[UIActionSheet alloc]

    initWithTitle:actionSheetTitle

    delegate:self

    cancelButtonTitle:cancelTitle

    destructiveButtonTitle:nil

    otherButtonTitles:images, vedios, files, nil];

Answer

NEWSLETTER

Enter your email address here always to be updated. We promise not to spam!