ios - uialertview 有光泽的外观和感觉

标签 ios xcode5 uialertview

我创建了一个 uialertview

UIAlertView *alert = [[UIAlertView alloc]
                                initWithTitle:@"Prohibited"
                                message:@"In-App Purchase is disabled, cannot make a purchase!"
                                delegate:self
                                cancelButtonTitle:nil
                                otherButtonTitles:@"Ok", nil];
[alert show];

创建如下对话框

enter image description here

但是我需要类似的东西

enter image description here

如何获得这种光鲜亮丽的外观和感觉?在 iOS 7.1 中工作,xocode 5。

我的应用使用 UIWebView、UIViewController

最佳答案

iOS 6 和更低版本的操作系统上,它看起来像图片中看到的那样有光泽。 iOS 7 现在是平的。

现在,如果您希望通过继承它来创建自己的 UIAlertView。有一些教程可以教您如何操作。但是您需要创建自己的图形并且会导致额外的编程。

您所有的自定义绘图都必须在 drawRect 内或覆盖 UIAlertView 中的各种元素。

我会看看这个 github 项目是如何对 UIAlertView 进行自定义的 https://github.com/Sumi-Interactive/SIAlertView

例如:

enter image description here

关于ios - uialertview 有光泽的外观和感觉,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23348710/

相关文章:

ios - Xcode 5.1 上的错误 Apple Mach-O 链接器警告

ios - 用户在 UIAlertControl 中完成操作时停止关闭 UIViewController

iphone - 用户将 NSNumbers 输入变量的好方法

ios - 如何向 Collection View 单元格添加按钮

ios - CoreData NSManagedObject 子类 - 预期标识符

objective-c - 子类化UIAlertView

ios - 在横向模式下,如何强制 UIAlertView 显示完整消息而不滚动?

iphone - uiTableView 在删除单元格时第二次崩溃

ios - 如何禁用collectionview弹跳效果而不影响刷新控制功能?

iphone - UITableView 内容 "Static cell"在 iOS7 中不起作用