iPad/iPhone..操作表

发布于 2024-10-16 12:28:24 字数 1199 浏览 1 评论 0原文

我使用了带有操作表的选择器视图和日期选择器,它在 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

反目相谮 2024-10-23 12:28:24

在 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

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文