问题描述
我知道 Popover 控制器只能在 iPad 设备上使用,但在下面的问题中有一条评论,其中用户提到了类别,代码如下,iPhone 的 UIPopoverController 不工作?
I know that Popover controllers are for use exclusively on iPad devices, but on below question there is a comment in which user has mentioned about category, code is as below,UIPopoverController for iphone not working?
// UIPopoverController+iPhone.h file
@interface UIPopoverController (iPhone)
+ (BOOL)_popoversDisabled;
@end
// UIPopoverController+iPhone.m file
@implementation UIPopoverController (iPhone)
+ (BOOL)_popoversDisabled {
return NO;
}
@end
这是正确的方式吗?苹果会批准吗?,
Is this right way?Will Apple approve this?,
我的 iPad 应用程序已经完成,现在我正在制作它的通用应用程序,所以我想添加这个类别而不是使用任何自定义弹出框,以便它可以解决我的问题并减少开发工作.
My iPad application is already done, now I am making it universal application, so instead of using any custom popover I want to add this category so that it will solve my issue and will reduce development efforts.
推荐答案
这是一种非常骇人听闻的方式,您将其放在 AppStore 上会冒很大的风险.当然,有人可能在商店中放置了一个他们忽略了这一点的版本,但它随时可能中断,Apple 可能会决定删除他的应用.
This is very hacky way, and you'll be taking a big risk putting it on the AppStore. Sure someone may have put a version in the store where they overlooked this, but it can break any moment and Apple may decide to remove his app.
你在 iPhone 上测试过 popovers 吗?你会在iOS7.1中测试吗?它在 iOS7.2 或 iOS 7.3 上的工作方式是否完全相同?
Have you tested popovers on iPhone? Will you test in iOS7.1? Will it work exactly the same on iOS7.2 or iOS 7.3?
更好的解决方案是采用弹出窗口的开源实现并将其用于 iPhone(或两者).
A far better solution would be to take an open source implementation of popovers and use that for iPhone (or both).
这篇关于iPhone 的 UIPopoverController 通过实现类别的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!