问题
Before I implement something similar for the iPhone, I\'m wondering if anyone has implemented something similar of the UIPopOverController for the iPhone. This is so far only available for iPad.
回答1:
See my implementation here: https://github.com/werner77/WEPopover
It has the same interface as the UIPopoverController but is generalized for iPhone and with support for custom background views.
回答2:
I have provided another alternative SGPopoverController at http://github.com/KJoyner/SeaGlass. Like the WEPopover, this has a similar interface to UIPovoerController but works on the iPhone. This version handles more corner cases, works both modally and non-modally, supports passthrough views, and more.
回答3:
Create UIPopover+iPhone.h
#import <Foundation/Foundation.h>
@interface UIPopoverController (overrides)
+ (BOOL)_popoversDisabled;
@end
回答4:
There's a reason UIPopoverController isn't a standard UI element on the iPhone, is that screen space is rather restricted. Having a popover, that's easily readable, implies that a fair amount of the iPhone screen will be taken up by the popover. Perhaps you should rethink your UI decision.
Maybe a coverVertical modal view?
回答5:
Found another git. Looks more updated and actively maintained. it uses QuantzCore to draw the popover, which looks as elegant as iOS's SDK native. Just for your reference: https://github.com/50pixels/FPPopover
回答6:
Basically the best way to do this is to implement custom UIAlertView subclasses that look/behave how you want, via custom animations and being able to click behind and disappear (if you want that functionality, as UIPopoverController has it)
Edit: you can also try using a view and presenting it modally, though the animations might not be what you are looking for.
来源:https://stackoverflow.com/questions/3878332/uipopovercontroller-for-iphone-currently-only-available-for-ipad