-1

I am new in ios. I am using Action sheet in my project.I want to ask that what can i do in order to add four buttons in UIaction sheet.Like this i want these foru image buttons in a single row

Here is my try code but it is showing four buttons on four different rows:

 (IBAction)showNormalActionSheet:(id)sender {
    UIActionSheet *actionSheet = [[UIActionSheet alloc] initWithTitle:@""?"
                                                             delegate:self
                                                    cancelButtonTitle:@"Cancel"
                                               destructiveButtonTitle:@"Delete it"
                                                    otherButtonTitles:@"Copy", @"Move", @"Duplicate", nil];

    [actionSheet showInView:self.view];
}
Mishal Awan
  • 724
  • 2
  • 11
  • 24

2 Answers2

1

UIActionsheet has been deprecated and is no longer working in iOS8. UIActionsheet will be replaced by UIAlertController. Your issue might be due to this update UIAlertController Apple documentation

UIAlertController gives you full power to customize your AlertView. If you have an app in app store that is using UIAlertView, your app will be broken in iOS 8.

How to use UIAlertController check this demo on Github AlertViewController for iOS8 Demo

A library for custom views like AlertViewController is here

Logic
  • 789
  • 9
  • 24
0

UIActionsheet in iOS8 Swift language

var alert = UIAlertController(title: "NewProject", message:"Password is not mathch.", preferredStyle: UIAlertControllerStyle.ActionSheet)
            alert.addAction(UIAlertAction(title: "OK", style: UIAlertActionStyle.Default, handler:{ (ACTION :UIAlertAction!)in

                println("User click Ok button")

                self.txtPassword.becomeFirstResponder()

            }))

            self.presentViewController(alert, animated: true, completion: nil)
Anbu.Karthik
  • 77,564
  • 21
  • 153
  • 132
Kirit Modi
  • 21,371
  • 13
  • 83
  • 108