草庐IT

Actionsheet

全部标签

ios - 如何像 actionSheet 一样呈现 UIViewController?

我想呈现一个只占据屏幕下半部分的View,背景View保持可见,没有可能的交互。就像一个带有actionSheet风格的UIAlertContoller。如何在Swift中做到这一点? 最佳答案 将该View创建为普通的UIViewController,为其分配一个标识符,然后像这样实例化它:(尽管将其保留为成员变量,您将需要它)varcontroller=self.storyboard!.instantiateViewControllerWithIdentifier("yourIdentifier")as!UIViewContro

ios - UIAlertController/ActionSheet 在 iPad 上崩溃,如何传递发件人?

我想在iPhone和iPad设备上显示一个ActionSheet。虽然我的代码在iPhone上可以正常工作,但在iPad上却不行。这样做的原因是我需要指定显示弹出窗口的位置。因此,我尝试使用thisanswer中提出的代码.我目前遇到的问题是,我不知道如何将参数sender传递给方法。例如,我有一个UITableViewRowAction,单击它时应显示ActionSheet:functableView(tableView:UITableView,editActionsForRowAtIndexPathindexPath:NSIndexPath)->[UITableViewRowAct

ios - 带有白色边框的 alertController

我创建了一个带有操作表和两个按钮的警报Controller。由于操作表将具有圆角边缘,因此在屏幕上的四个角上会出现白色。我尝试更改alertcontroller的背景颜色,但这是将操作表制作为具有锐边而不是圆形边框的矩形。我尝试将View背景颜色设置为清除颜色也尝试设置边界半径。这是我的行动表。我希望那些白色边缘不可见。另外,如何更改取消的背景颜色。letcancelAction=UIAlertAction(title:"Cancel".localize(),style:.cancel){_in//thisiswhereIamcreatingthecancelAction}编辑-1:为

swift - 在 iPad 上的 SwiftUI 中呈现 ActionSheet

我有一个ActionSheet可以在iPhone设备上很好地呈现。但它会在iPad上崩溃。说它需要弹出窗口的位置。有没有人有幸使用这段代码?我正在使用iOS13beta3和Xcode11beta3。(这使用了在beta2中不可用的呈现ActionSheet的版本)importSwiftUIstructContentView:View{@StatevarshowSheet=falsevarbody:someView{VStack{Button(action:{self.showSheet.toggle()}){Text("Show")}.presentation($showSheet){

ios - 在 swift 中使用 uiimagepickercontroller 裁剪图像

我目前正在快速制作一个程序,其中涉及使用操作表从相机或照片库中选择图像的屏幕。这是功能齐全的,但我希望能够从所选图像中选择一个方形部分,类似于苹果默认应用程序。我该如何实现?这是我的功能代码:funcchooseImage(_sender:Any){letimagePickerController=UIImagePickerController()imagePickerController.delegate=selfletactionSheet=UIAlertController(title:"PhotoSource",message:"Chooseasource",preferred

ios - 在 iPhone 上的弹出窗口中呈现 UIAlertController ActionSheet

我正在创建并呈现一个ActionSheet,如下所示:letalertController=UIAlertController(title:nil,message:nil,preferredStyle:.ActionSheet)alertController.modalPresentationStyle=.Popover//AddsomebuttonsalertController.popoverPresentationController?.delegate=selfalertController.popoverPresentationController?.barButtonIte

ios - 在 iPhone 上的弹出窗口中呈现 UIAlertController ActionSheet

我正在创建并呈现一个ActionSheet,如下所示:letalertController=UIAlertController(title:nil,message:nil,preferredStyle:.ActionSheet)alertController.modalPresentationStyle=.Popover//AddsomebuttonsalertController.popoverPresentationController?.delegate=selfalertController.popoverPresentationController?.barButtonIte

iphone - 使用超过 6 个自定义按钮时 UIActionSheet buttonIndex 值错误?

我在iPhone(iOS4.2)上使用UIActionSheet时发现了一个奇怪的问题。考虑这段代码:-(BOOL)application:(UIApplication*)applicationdidFinishLaunchingWithOptions:(NSDictionary*)launchOptions{[self.windowaddSubview:viewController.view];[self.windowmakeKeyAndVisible];UIActionSheet*actionSheet=[[UIActionSheetalloc]initWithTitle:@"Te

iphone - 使用超过 6 个自定义按钮时 UIActionSheet buttonIndex 值错误?

我在iPhone(iOS4.2)上使用UIActionSheet时发现了一个奇怪的问题。考虑这段代码:-(BOOL)application:(UIApplication*)applicationdidFinishLaunchingWithOptions:(NSDictionary*)launchOptions{[self.windowaddSubview:viewController.view];[self.windowmakeKeyAndVisible];UIActionSheet*actionSheet=[[UIActionSheetalloc]initWithTitle:@"Te

ios - 在 IOS 8 的 UIActionSheet 中添加 UIPickerView 不起作用

我正在将UIPickerView添加到UIActionsheet但它在ios7中完美运行但在ios8中无法运行.请帮我解决这个问题。我附上了截图。谢谢我为此使用了以下代码。UIActionSheet*actionSheet;NSString*pickerType;-(void)createActionSheet{if(actionSheet==nil){//setupactionsheettocontaintheUIPickeractionSheet=[[UIActionSheetalloc]initWithTitle:@"Pleaseselect"delegate:selfcance