Tag: uiactionsheet

像在UIDocumentInteractionController中一样添加图像到UIActionSheetbutton

是否有可能添加一个图像的UIActionSheet的button在UIDocumentInteractionController看到? 如果是这样,请让我知道它是如何完成的。

更改UIActionSheet中的项目颜色 – iOS 8

我一直在使用下面的代码来更改UIActionSheet添加的项目的文本颜色。 – (void)willPresentActionSheet:(UIActionSheet *)actionSheet { for (UIView *subview in actionSheet.subviews) { if ([subview isKindOfClass:[UIButton class]]) { UIButton *button = (UIButton *)subview; [button setTitleColor:[UIColor blackColor] forState:UIControlStateNormal]; } } } 它在iOS7工作正常,但在iOS8上面的代码不会更改项目的文本颜色。 现在我的问题是如何改变UIActionSheet使用iOS8添加的项目的文本颜色? 附加信息: 我添加了断点来查看是否执行上面的代码中的以下行: UIButton *button = (UIButton *)subview; [button setTitleColor:[UIColor blackColor] forState:UIControlStateNormal]; 这些行不会被执行。 所以, if([subview isKindOfClass:[UIButton class]])对于actionSheet.subviews所有项目总是为false 。 所以我认为UIActionSheet的观点已经改变了。

问题与UIActionSheet

当我运行我的应用程序,我点击button的行动表出现这样的: 提交由其超级视图剪辑的操作表。 一些控件可能不响应触摸。 在iPhone上尝试 – [UIActionSheet showFromTabBar:]或 – [UIActionSheet showFromToolbar:]而不是 – [UIActionSheet showInView:]。 我该如何解决?

来自iOS8 GM的Popover的UIActionSheet

任何人都试图从popup窗口显示UIActionSheet时得到这个消息? 你的应用程序提供了UIAlertControllerStyleActionSheet风格的UIAlertController()。 具有此样式的UIAlertController的modalPresentationStyle是UIModalPresentationPopover。 您必须通过警报控制器的popoverPresentationController为此popup窗口提供位置信息。 您必须提供sourceView和sourceRect或barButtonItem。 如果在显示警报控制器时不知道此信息,则可以在UIPopoverPresentationControllerDelegate方法-prepareForPopoverPresentation中提供此信息。 在此之前,我使用了一些解决方法将UIActionSheet转换为UIAlertController,并且工作正常。 但是,似乎苹果试图解决UIActionSheet问题,我不想使用我的解决方法 – 但似乎我没有select…

Swift UIAlertController – > ActionSheet iPad的iOS8崩溃

目前我遇到了我的ActionSheet很大的麻烦。 在iPhone上它工作的很好,但在iPad上它只会崩溃 我只用一个button创build一个新项目 import UIKit extension ViewController : UIActionSheetDelegate { func actionSheet(actionSheet: UIActionSheet, didDismissWithButtonIndex buttonIndex: Int) { if actionSheet.tag == 0 { if buttonIndex == 1 { // doing something for "product page" } else if (buttonIndex == 2) { // doing something for "video" } } } } class ViewController: UIViewController, UIActionSheetDelegate { @IBAction […]

UIActionSheet iOS Swift

如何在iOS Swift中执行UIActionSheet? 这是我编写UIActionSheet的代码。 @IBAction func downloadSheet(sender: AnyObject) { let optionMenu = UIAlertController(title: nil, message: "Choose Option", preferredStyle: .ActionSheet) let saveAction = UIAlertAction(title: "Save", style: .Default, handler: { (alert: UIAlertAction!) -> Void in println("Saved") }) let deleteAction = UIAlertAction(title: "Delete", style: .Default, handler: { (alert: UIAlertAction!) -> Void in println("Deleted") }) let cancelAction = UIAlertAction(title: "Cancel", […]

UIActionSheet在iOS 7 GM的最后一个项目上没有显示分隔符

这可能是iOS7上的一个错误。 但是最后一个button并没有与前一个button分开 正如你可以从图像中看到的。 这在使用iOS7 GM的模拟器和设备上都会发生。 其他人是否也有同样的问题? UIActionSheet *actionSheet = [[UIActionSheet alloc] initWithTitle:@"Title" delegate:self cancelButtonTitle:nil destructiveButtonTitle:nil otherButtonTitles:@"First", @"Second", @"Third", @"Fourth", nil]; [actionSheet showInView:self.view]; 正如你所看到的代码很简单。 任何想法如何解决这个问题? 或者我可以使用一些第三方库来代替UIActionSheet?

ActionSheet不工作的iPad

我在我的应用程序中使用ActionSheet。 在我的iPhone上,它工作,但它不在iPad模拟器上。 这是我的代码: @IBAction func dialog(sender: AnyObject) { let optionMenu = UIAlertController(title: nil, message: "Choose Option", preferredStyle: .ActionSheet) let deleteAction = UIAlertAction(title: "Delete", style: .Default, handler: { (alert: UIAlertAction!) -> Void in println("Filtre Deleted") }) let cancelAction = UIAlertAction(title: "Cancel", style: .Cancel, handler: { (alert: UIAlertAction!) -> Void in println("Cancelled") }) optionMenu.addAction(deleteAction) optionMenu.addAction(cancelAction) self.presentViewController(optionMenu, animated: […]

在UIActionSheet从IOS 8添加UIPickerView不起作用

我将UIPickerView添加到UIActionsheet但它的工作完美的ios 7但不工作在ios 8 。 请帮我解决这个问题。 在这里我附上截图。 谢谢 我正在使用下面的代码。 UIActionSheet *actionSheet; NSString *pickerType; – (void)createActionSheet { if (actionSheet == nil) { // setup actionsheet to contain the UIPicker actionSheet = [[UIActionSheet alloc] initWithTitle:@"Please select" delegate:self cancelButtonTitle:nil destructiveButtonTitle:nil otherButtonTitles:nil]; actionSheet.backgroundColor = [UIColor clearColor]; UIToolbar *pickerToolbar = [[UIToolbar alloc] initWithFrame:CGRectMake(0, 0, 320, 40)]; pickerToolbar.barStyle = UIBarStyleBlackOpaque; [pickerToolbar sizeToFit]; […]

在iOS8 – iOS10中从操作表代表以模态方式呈现视图控制器

所以我注意到,在iPad上,当试图从UIActionSheet的委托方法中呈现视图控制器时,在iOS8 beta 3( 更新 :仍然发生在iOS 10中)上,“nothing”发生并且日志消息被输出到debugging控制台,表示在转换警报控制器的过程中尝试了演示文稿: Warning: Attempt to present <UIViewController: 0x…> on <ViewController: 0x…> which is already presenting <UIAlertController: 0x…>