将框架设置为 UIActionSheet

发布于 2024-12-14 13:58:43 字数 120 浏览 1 评论 0原文

我正在开发 iPad 应用程序。我已经使用了电子邮件和打印功能。为了显示这些选项,我使用了 UIActionSheet。但是UIActionSheet的大小太大了。我可以为 UIActionSheet 设置框架以减小其大小吗?

I am working on an iPad application. I have used email and print functionality into it. To show these options I have used UIActionSheet. But the size of UIActionSheet is too large. Can I set frames to UIActionSheet to reduce its size?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

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

发布评论

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

评论(2

神爱温柔 2024-12-21 13:58:43

您至少可以更改操作表的边界,尤其是高度值。这甚至可以在调用 showFromToolbar: 等之后完成。请注意,这不会重新定位按钮,而似乎只是在操作表底部添加/删除空间。

在更改布局之前,必须问自己这是否真的有必要,或者是否可能有任何其他选项,但我见过有必要这样做的情况(例如 UIActionSheet 中的 UIDatePicker)。

You can at least change the bounds of the action sheet, especially the height value. This can at even be done right after the call to showFromToolbar: etc. Note that this does not reposition the buttons but only seems to add/remove space from the bottom of the action sheet.

Before changing the layout one has to ask themselves if this is really necessary or if there might be any other option, but I've seen cases where this is necessary (e.g. an UIDatePicker within an UIActionSheet).

萌梦深 2024-12-21 13:58:43
- (IBAction)openclick:(id)sender
{
    if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad)
    {


        UIActionSheet *actionsheetttt = [[UIActionSheet alloc] initWithTitle:nil delegate:self cancelButtonTitle:nil destructiveButtonTitle:nil otherButtonTitles:@"Click me",@"hows You", nil];
        actionsheetttt.tag = 777;
        actionsheetttt.actionSheetStyle = UIActionSheetStyleBlackOpaque;
        [actionsheetttt showFromRect:CGRectMake(215,319,300,500) inView:self.view animated:YES];
        [actionsheetttt release];
}
    else
    {

    }

}
- (IBAction)openclick:(id)sender
{
    if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad)
    {


        UIActionSheet *actionsheetttt = [[UIActionSheet alloc] initWithTitle:nil delegate:self cancelButtonTitle:nil destructiveButtonTitle:nil otherButtonTitles:@"Click me",@"hows You", nil];
        actionsheetttt.tag = 777;
        actionsheetttt.actionSheetStyle = UIActionSheetStyleBlackOpaque;
        [actionsheetttt showFromRect:CGRectMake(215,319,300,500) inView:self.view animated:YES];
        [actionsheetttt release];
}
    else
    {

    }

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