相关疑难解决方法(0)

从IOS 8在UIActionSheet中添加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];

        UIImageView *imageObj = [[UIImageView alloc]initWithFrame:CGRectMake(0, 0, 320, 40)];
        imageObj.image = [UIImage imageNamed:@"header.png"];
        [pickerToolbar addSubview:imageObj];

        UIButton *cancelBtn = [UIButton buttonWithType:UIButtonTypeCustom]; …
Run Code Online (Sandbox Code Playgroud)

iphone uipickerview uiactionsheet ios ios8

52
推荐指数
4
解决办法
3万
查看次数

有没有办法在Swift中将UIPickerView添加到UIAlertController(Alert或ActionSheet)中?

我对swift(以及iOS编程)完全不熟悉,但我开始搞乱它(当一切仍然是beta版本时,这不是一个好主意:D).所以我试着自己弄清楚,但仍然没有.甚至试图添加包含选择器的子视图而没有任何成功.那么任何人都可以帮助我吗?

uipickerview ios swift uialertcontroller

25
推荐指数
4
解决办法
5万
查看次数

ActionSheetPicker替换ios 8

在iOS 7中一直使用ActionSheetPicker让用户选择一个选项,它一直运行良好,直到我安装Xcode beta 2并在iOS 8中运行我的项目.有没有办法在iOS 8中执行此操作?

截图:http://imgur.com/a/Bs6Xl

感谢您的帮助.

uipickerview uiactionsheet ios

10
推荐指数
2
解决办法
6044
查看次数

子类化UIAlertController

在iOS 8之前,我们不得不使用UIAlertViewUIActionSheet

我们不允许在它们上面混淆视图层次结构或子类.

UIAlertView 文档

UIAlertView类旨在按原样使用,不支持子类化.此类的视图层次结构是私有的,不得修改.

UIActionSheet 文档

UIActionSheet不是设计为子类,也不应该为其层次结构添加视图.如果您需要提供比UIActionSheet API提供的更多自定义的工作表,您可以创建自己的工作表并使用presentViewController以模态方式呈现它:animated:completion:.

然而,iOS8 Apple已经推出UIAlertController了更换两者UIAlertViewUIActionSheet(请查看此处的预发布文档).

因此,在这个预发布文档中,没有任何关于无法子类化或更改视图层次结构,它甚至有这种方法,addTextFieldWithConfigurationHandler:因此我们能够更改视图层次和/或子类,UIAlertController而不必担心Apple是否会批准或拒绝我们的应用程序?

objective-c uialertview uiactionsheet uialertcontroller

9
推荐指数
2
解决办法
7672
查看次数