How to customize / style a UIPopoverController

后端 未结 10 1835
闹比i
闹比i 2020-11-28 05:39

I\'m working on an iPad application and I\'m using UIPopoverControllers. I\'m at the part where the app needs to be branded and styled and i\'m wondering how to change the c

相关标签:
10条回答
  • 2020-11-28 06:32

    from ios 5 onward it is can be done, here is a library

    https://github.com/ddebin/DDPopoverBackgroundView

    just look at the documentation , and it is quite easy

    good luck

    0 讨论(0)
  • 2020-11-28 06:34

    Remove UIPopoverController border:

     NSArray* subviews = ((UIView*)[popupController.contentViewController.view.superview.superview.superview.subviews objectAtIndex:0]).subviews;
    for(UIView *subview in subviews){
        [subview removeFromSuperview];
    }
    
    0 讨论(0)
  • 2020-11-28 06:36

    It's impossible for now.

    It's what I call the "Box in a Box" model. You get control of the box inside of the box (the UIViewController inside of the UIPopoverController), but you have very limited control over the actual popover itself. Outside of the arrow direction and the size, you can't change much else. There are also options for a modal effect popover, which dims everything else when it shows up, but I haven't tried to get it working.

    I'm sure you've noticed there is no UIPopover class by now.

    The answer you want to hear:
    If you really want to style one that bad, just write your own. It's really not that hard.

    The link you want to click:
    Cocoacontrols is an index of iOS and OSX components available on GitHub, they have some popover stuff.

    0 讨论(0)
  • 2020-11-28 06:40

    check out these latest projects leveraging UIPopoverBackgroundView https://github.com/CRedit360/C360PopoverBackgroundView https://github.com/GiK/GIKPopoverBackgroundView

    0 讨论(0)
提交回复
热议问题