Popover / ActionSheet 样式是否与系统应用程序相匹配?

发布于 2024-11-25 13:58:24 字数 209 浏览 2 评论 0原文

我希望有人可以帮助我...我想在我正在开发的 iPad 应用程序中使用弹出窗口(或显示为弹出窗口的操作表)。

我遇到的问题是让它们看起来像我想要的那样。我希望我的弹出窗口看起来像许多核心应用程序中使用的标准弹出窗口。

当您进入作为分割视图一部分的弹出窗口或“打印机选项”弹出窗口时,我在背景渐变上获得白色标题时遇到了特殊问题。

有什么方法可以做到这一点吗?

I'm hoping somebody can help me... I want to use popovers (or actionsheets displayed as popovers) in the iPad app I'm working on.

The problem I'm having is making them look the way I want. I want my popovers to look like the standard ones used in a number of the core Apps.

I'm having particular problems getting a white heading over the background gradient as you get in the popover that is part of the split view, or the "Printer Options" popover.

Is there some way to do this?

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

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

发布评论

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

评论(1

只有影子陪我不离不弃 2024-12-02 13:58:24

在弹出窗口中显示操作表的标准方法如下:

-(IBAction)moreActions:(UIBarButtonItem *)it{
    UIActionSheet *act = [[UIActionSheet alloc] initWithTitle:@"What should we do?" 
                                                     delegate:self 
                                            cancelButtonTitle:nil 
                                       destructiveButtonTitle:nil 
                                            otherButtonTitles:@"Render Video (again)",@"Share Story",@"Email Story",@"YouTube",@"Save to Library",nil];

    act.actionSheetStyle = UIActionSheetStyleBlackTranslucent;
    [act showFromBarButtonItem:it animated:YES];
    [act release];
}

这将在 it UIBarButtonItem 的弹出窗口内显示 UIActionSheet。这看起来与核心应用程序中的完全一样。如果您不从 UIBarButtonItem 进行呈现,请使用 - (void)showFromRect:(CGRect)rect inView:(UIView *)viewAnimated:(BOOL)animated 方法从任意帧进行呈现。

这就是你在做的事吗?

The standard way to present an action sheet in a popover is the following:

-(IBAction)moreActions:(UIBarButtonItem *)it{
    UIActionSheet *act = [[UIActionSheet alloc] initWithTitle:@"What should we do?" 
                                                     delegate:self 
                                            cancelButtonTitle:nil 
                                       destructiveButtonTitle:nil 
                                            otherButtonTitles:@"Render Video (again)",@"Share Story",@"Email Story",@"YouTube",@"Save to Library",nil];

    act.actionSheetStyle = UIActionSheetStyleBlackTranslucent;
    [act showFromBarButtonItem:it animated:YES];
    [act release];
}

This will show the UIActionSheet inside a popover from the it UIBarButtonItem. This looks exactly like in the core apps. If you are not presenting from a UIBarButtonItem use the - (void)showFromRect:(CGRect)rect inView:(UIView *)view animated:(BOOL)animated method to present from an arbitrary frame.

Is this what you are doing?

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