iPad/iPhone..操作表
我使用了带有操作表的选择器视图和日期选择器,它在 iPhone 中运行良好。 我将 iPhone 应用程序升级为 iPad。我设置了操作表自动调整大小属性,但它没有在 ipad 中显示,并且当我旋转 iphone 时。这是我的代码
UIActionSheet *actionSheet = [[UIActionSheet alloc] initWithTitle:@"Select Payment Type"
delegate:self
cancelButtonTitle:@"Done"
destructiveButtonTitle:@"Cancel"
otherButtonTitles:nil];
// Add the picker
picker = [[UIPickerView alloc] initWithFrame:CGRectMake(0,185,0,0)];
picker.delegate = self;
picker.showsSelectionIndicator = YES; // note this is default to NO
picker.autoresizingMask=UIViewAutoresizingFlexibleWidth|UIViewAutoresizingFlexibleHeight;
[actionSheet addSubview:picker];
[actionSheet showInView:self.view];
[actionSheet setBounds:CGRectMake(0,0,320, 700)];
actionSheet.autoresizingMask=UIViewAutoresizingFlexibleWidth|UIViewAutoresizingFlexibleHeight|UIViewAutoresizingFlexibleTopMargin
|UIViewAutoresizingFlexibleRightMargin|UIViewAutoresizingFlexibleLeftMargin|UIViewAutoresizingFlexibleBottomMargin;
[picker release];
[actionSheet release];
I used picker view and date picker with action sheet and it is working fine in iphone.
I upgraded my iphone app for ipad. i set action sheets autoresize property but it is not displaying in ipad and when i rotate iphone.Here is my code
UIActionSheet *actionSheet = [[UIActionSheet alloc] initWithTitle:@"Select Payment Type"
delegate:self
cancelButtonTitle:@"Done"
destructiveButtonTitle:@"Cancel"
otherButtonTitles:nil];
// Add the picker
picker = [[UIPickerView alloc] initWithFrame:CGRectMake(0,185,0,0)];
picker.delegate = self;
picker.showsSelectionIndicator = YES; // note this is default to NO
picker.autoresizingMask=UIViewAutoresizingFlexibleWidth|UIViewAutoresizingFlexibleHeight;
[actionSheet addSubview:picker];
[actionSheet showInView:self.view];
[actionSheet setBounds:CGRectMake(0,0,320, 700)];
actionSheet.autoresizingMask=UIViewAutoresizingFlexibleWidth|UIViewAutoresizingFlexibleHeight|UIViewAutoresizingFlexibleTopMargin
|UIViewAutoresizingFlexibleRightMargin|UIViewAutoresizingFlexibleLeftMargin|UIViewAutoresizingFlexibleBottomMargin;
[picker release];
[actionSheet release];
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
在 iPad 中使用 Actionsheet 时应记住的一点是,它显示为 PopOver ViewController。这是 iPad 中 Action Sheet 的默认行为。
干杯
One point you should keep in mind using Actionsheet in iPad is that it is displayed as PopOver ViewController.It is the default behavior of Action Sheet in iPad.
Cheers