开发者

Popover / ActionSheet styling to match system apps?

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?


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?

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜