ios - 带有按钮的 UIAlertView,标题重叠?

标签 ios iphone uialertview

我有一个带有 4 个按钮和一个标题的警报 View 。它在 iOS 7 上运行良好,但在 iOS 6 上标题与第一个按钮重叠。 我该如何解决? 提前谢谢你。

更新:这是代码:

UIAlertView * dialog = [[UIAlertView alloc] init];
[dialog setDelegate:self];
dialog.alertViewStyle=UIAlertViewStyleDefault;
[dialog setTitle:@"These are your choices"];
[dialog setMessage:@""];
[dialog addButtonWithTitle:@"Button 1"];
[dialog addButtonWithTitle:@"Button 2"];
[dialog addButtonWithTitle:@"Button 3"];
[dialog addButtonWithTitle:@"Cancel"];
[dialog show];

截图如下:

screenshot

最佳答案

我猜这是在 iOS 6 中初始化后添加按钮时出现的错误。在 initWithTitle:message:delegate:cancelButtonTitle:otherButtonTitles: 初始化程序中添加按钮,您应该没问题。

关于ios - 带有按钮的 UIAlertView,标题重叠?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22200491/

相关文章:

ios - 显示来自非 UI 类的警报

ios - Titanium 中的 TableViewRow 高度

javascript - 焦点到 iPhone 上文本区域的开头?

iphone - 在 App 内购买 AlertMessage

iphone - 为 iPad 或 iPhone 加载单独的 XIB 时出现问题

iPhone:禁用 "double-tap spacebar for ."快捷方式?

ios - 可达性转到 "Wi-Fi Settings"按钮不起作用

ios - 如何在 iOS 上构建类似 Facebook/Slack 的上下文菜单?

ios - 如何在加载 View Controller 时更改状态栏样式?

ios - 获取 UICollectionView 部分的框架