我想要
- 示出了选择器视图(向上滑动)
- 停用背景而它的可见
- 显示(UIActionSheet)按钮在底部(未在顶部)
在我看来,首先一个简单的解决方案,因为你可以在网页,但所有的解决方案位置到处添加选择器以一个动作片,在顶部的按钮找到代码, 我需要把按钮的动作片的底部(对齐?)。
这可能吗? 我想这是,如果我看: 实例
问候
Jeven
编辑(我的解决方案基于编码爸爸溶液)
UIActionSheet *actionSheet = [[UIActionSheet alloc] initWithTitle:nil
delegate:nil
cancelButtonTitle:nil
destructiveButtonTitle:nil
otherButtonTitles:nil];
[actionSheet setActionSheetStyle:UIActionSheetStyleBlackTranslucent];
CGRect pickerFrame = CGRectMake(0, 0, 0, 0);
UIPickerView *pickerView = [[UIPickerView alloc]initWithFrame:pickerFrame];
pickerView.showsSelectionIndicator = YES;
pickerView.dataSource = self;
pickerView.delegate = self;
UISegmentedControl *backButton = [[UISegmentedControl alloc] initWithItems:[NSArray arrayWithObjects:@"Back", nil]] ;
[backButton addTarget:self action:@selector(someFunction:) forControlEvents:UIControlEventValueChanged];
backButton.tintColor = [UIColor colorWithRed:0.10 green:0.20 blue:0.52 alpha:0.5];
backButton.segmentedControlStyle = UISegmentedControlStyleBar;
[backButton addTarget:self action:@selector(btnActionCancelClicked:) forControlEvents:UIControlEventAllEvents];
backButton.frame = CGRectMake(20.0, 220.0, 280.0, 40.0);
UISegmentedControl *acceptButton = [[UISegmentedControl alloc] initWithItems:[NSArray arrayWithObjects:@"Accept", nil]] ;
[acceptButton addTarget:self action:@selector(anotherFunction:) forControlEvents:UIControlEventValueChanged];
acceptButton.tintColor = [UIColor colorWithRed:0.10 green:0.20 blue:0.52 alpha:0.5];
acceptButton.segmentedControlStyle = UISegmentedControlStyleBar;
acceptButton.frame = CGRectMake(20.0, 280.0, 280.0, 40.0);
[actionSheet addSubview:pickerView];
[actionSheet addSubview:backButton];
[actionSheet addSubview:acceptButton];
[actionSheet showInView:[[UIApplication sharedApplication] keyWindow]];
[actionSheet setFrame:CGRectMake(0,150,320, 400)];
......那么就适用iPhone 5 / iPhone 4的依赖视角大小限制
组织编写了:又一个暗示! 本来我想用标准Actionsheet,但并没有要放置pickerview底部。 我没有找到一个方法如何移动的按钮。 显然,这真的很简单: 添加的UIView作为子视图的UIActionSheet好知道;)