ios - 更改 UIAlertView 大小

标签 ios cocoa-touch uikit cocos2d-iphone uialertview

在我的 cocos2d 游戏中,我不能改变 uialertview 的大小,我已经将 statusbarorientation 更改为横向,现在想用 f​​rame 初始化 alertview,而 initwithframe 方法不影响 alertview 的大小,每次 alert 的大小是一样,有什么办法可以改变吗?

最佳答案

这就是我所做的。在您的 Controller 中创建您的 uialertview。然后在你的 Controller 中覆盖以下类(在设置 uialertview 委托(delegate)之后......即 myalertview.delegate=viewcontroller)

- (void)willPresentAlertView:(UIAlertView *)alertView {
    [alertView setFrame:CGRectMake(1, 20, 2700, 400)];
}

帧大小应该在此之后改变。

关于ios - 更改 UIAlertView 大小,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8605685/

相关文章:

iphone - 无法在 actionSheet-delegate 方法中设置 tabBarItem-title

ios - 有没有办法在 SwiftUI 中创建新的手势?

android - 适用于 Android/iOS 的 WMS View /库

ios - 如何将tableView的特定行单元格的图像设置为动态图像

ios - VoiceOver 正在读取我的 UIAlertController 后面的 View Controller 内容

ios - Xcode Assets 目录问题

ios - 是否可以获取 MPMediaItem 的 iTunes Store ID?

ios - 为什么 Xcode 7 显示 *.tbd 而不是 *.dylib?

ios - 当 UINavigationController 妨碍时访问 UITableView(在 UISplitViewController 中)

iphone - 给定一个 CGPath,如何让它弯曲?