0
我知道很多人都问过同样的问题,我已经尝试了很多,我不知道我错过了什么部分,我仍然可以使它工作。Popup UIPickerView
我有一个9 * 9的表格,我想要显示和更改,由于Iphone屏幕的大小,我正在考虑一次显示一列。 我想要的是按左上角的按钮和UIPickerView将弹出允许我选择要显示的列,然后重新加载UITextFields。
任何人都可以给我一个详细的答案?我在这个(几个月)还是比较新的。 预先感谢您。
UIActionSheet *actionSheet = [[UIActionSheet alloc] initWithTitle:nil
delegate:nil
cancelButtonTitle:nil
destructiveButtonTitle:nil
otherButtonTitles:nil];
[actionSheet setActionSheetStyle:UIActionSheetStyleBlackTranslucent];
CGRect pickerFrame = CGRectMake(0, 40, 0, 0);
UIPickerView *pickerView = [[UIPickerView alloc] initWithFrame:pickerFrame];
pickerView.showsSelectionIndicator = YES;
pickerView.dataSource = self;
pickerView.delegate = self;
[actionSheet addSubview:pickerView];
UISegmentedControl *closeButton = [[UISegmentedControl alloc] initWithItems:[NSArray arrayWithObject:@"Close"]];
closeButton.momentary = YES;
closeButton.frame = CGRectMake(260, 7.0f, 50.0f, 30.0f);
closeButton.segmentedControlStyle = UISegmentedControlStyleBar;
closeButton.tintColor = [UIColor blackColor];
[closeButton addTarget:self action:@selector(dismissActionSheet:) forControlEvents:UIControlEventValueChanged];
[actionSheet addSubview:closeButton];
[closeButton release];
[actionSheet showInView:[[UIApplication sharedApplication] keyWindow]];
[actionSheet setBounds:CGRectMake(0, 0, 320, 485)];
上面是我找到的代码,好吗弹出,我已经加入的问题阵列pickerview,任何人都可以告诉我dismissActionSheet方法应该如何? 谢谢。
请发表您尝试添加一些代码的委托方法来处理,它如果我们能看到你做错了什么/你想做什么,我们会更容易帮助你。 – mkral
@mkral嗨,对于后期更新感到抱歉,上周我还在做其他事情。我更新了我的问题并列出了我使用的代码。 – user1491987