UIAlertController 显示小字符串。当字符串的大小变大时。那么此警报中的一些文本丢失了。是否有任何滚动功能可以滚动到剩余的文本?
var alert = UIAlertController(title: "title here", message: "about 30 line text here", preferredStyle: UIAlertControllerStyle.Alert)
alert.addAction(UIAlertAction(title: "OK", style: UIAlertActionStyle.Default, handler: nil))
self.presentViewController(alert, animated: true, completion: nil)
如何发出提醒,显示大于 30 行的文本。我用的是 swift。
最佳答案
它在 Playgrounds 中毫不费力地工作:
import UIKit
import PlaygroundSupport
PlaygroundPage.current.needsIndefiniteExecution = true
let window = UIWindow()
let viewController = UIViewController()
window.rootViewController = viewController
window.makeKeyAndVisible()
let message = (1...1000).reduce("") { $0 + "\($1)\n" }
let alert = UIAlertController(title: "title here", message: message, preferredStyle: .alert)
alert.addAction(UIAlertAction(title: "action here", style: .default, handler: nil))
viewController.present(alert, animated: true, completion: nil)
PlaygroundPage.current.liveView = window
我有 1000 条可滚动行:
关于ios - 具有滚动功能的大量文本的 UIAlertController?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27032471/