我确信答案是“ no ”,因为文档非常清楚。但我有点困惑。一个标准UIAlertView
很乏味,我想改善外观,似乎其他应用程序也这样做(参见下面的示例)。
另一种可能性是它们没有子类 UIAlertViews
.在这种情况下,这是如何实现的?
页面UIAlertViews状态
Appearance of Alert Views
You cannot customize the appearance of alert views.
那么我们如何获得类似于此处显示的示例的内容呢?
最佳答案
不,不要子类化它。从文档:
Subclassing Notes
The UIAlertView class is intended to be used as-is and does not support subclassing. The view hierarchy for this class is private and must not be modified.
你可以做的是创建一个 UIView 并让它的行为类似于 UIAlertView。这不是很困难,似乎是他们在你的行动中所做的。
关于ios - UIAlertView 应该被子类化吗?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21007058/