助けてください! :) Im大きな騒々しいここに。私は様々な情報源からこのコードを集めて、私が何をしているのか本当に分かっていません。私のアラートコントローラにはa textfield that I can write in, a 'cancel' action, an 'ok' action,と表示され、それにはmultiple 'input keyword to label' actions.アラートコントローラのアクションをスクロールする方法は? Xcode 8、Swift 3、IOS
It has so many actions (around 20 keyword actions that i need) that it either doesn't fit in the screen, it is covered by the keyboard, or it is in the way of the keyboard.と表示されます。このスペースに収まるように私の行動をスクロールする方法はありますか?
これは、その最後の画像のための私のコードです:私はUIAlertControllerアクションの一番上までスクロールする方法を発見したが
//Quality Text Box (9)
@IBOutlet weak var QualityLabel: UILabel!
@IBAction func QualityTapped(_ sender: UIButton) {
print("Quality Button Tapped")
openQualityAlert()
}
func openQualityAlert() {
//Create Alert Controller
let alert9 = UIAlertController (title: "Quality:", message: nil, preferredStyle: UIAlertControllerStyle.alert)
//Create "Keyword -> label" actions
let bt1 = UIAlertAction(title: "Abuse", style: UIAlertActionStyle.default){
(action) in self.QualityLabel.text = "Abuse"}
alert9.addAction(bt1)
let bt2 = UIAlertAction(title: "Hemmorhage", style: UIAlertActionStyle.default){
(action) in self.QualityLabel.text = "Hemmorhage"}
alert9.addAction(bt2)
let bt3 = UIAlertAction(title: "Discomfort", style: UIAlertActionStyle.default){
(action) in self.QualityLabel.text = "Discomfort"}
alert9.addAction(bt3)
let bt4 = UIAlertAction(title: "Acute", style: UIAlertActionStyle.default){
(action) in self.QualityLabel.text = "Acute"}
alert9.addAction(bt4)
let bt5 = UIAlertAction(title: "Disease", style: UIAlertActionStyle.default){
(action) in self.QualityLabel.text = "Disease"}
alert9.addAction(bt5)
let bt6 = UIAlertAction(title: "Rash", style: UIAlertActionStyle.default){
(action) in self.QualityLabel.text = "Rash"}
alert9.addAction(bt6)
let bt7 = UIAlertAction(title: "Itch", style: UIAlertActionStyle.default){
(action) in self.QualityLabel.text = "Itch"}
alert9.addAction(bt7)
let bt8 = UIAlertAction(title: "Burn", style: UIAlertActionStyle.default){
(action) in self.QualityLabel.text = "Burn"}
alert9.addAction(bt8)
let bt9 = UIAlertAction(title: "Abuse", style: UIAlertActionStyle.default){
(action) in self.QualityLabel.text = "Abuse"}
alert9.addAction(bt9)
let bt10 = UIAlertAction(title: "Hemmorhage", style: UIAlertActionStyle.default){
(action) in self.QualityLabel.text = "Hemmorhage"}
alert9.addAction(bt10)
let bt11 = UIAlertAction(title: "Discomfort", style: UIAlertActionStyle.default){
(action) in self.QualityLabel.text = "Discomfort"}
alert9.addAction(bt11)
let bt12 = UIAlertAction(title: "Acute", style: UIAlertActionStyle.default){
(action) in self.QualityLabel.text = "Acute"}
alert9.addAction(bt12)
let bt13 = UIAlertAction(title: "Disease", style: UIAlertActionStyle.default){
(action) in self.QualityLabel.text = "Disease"}
alert9.addAction(bt13)
let bt14 = UIAlertAction(title: "Rash", style: UIAlertActionStyle.default){
(action) in self.QualityLabel.text = "Rash"}
alert9.addAction(bt14)
let bt15 = UIAlertAction(title: "Itch", style: UIAlertActionStyle.default){
(action) in self.QualityLabel.text = "Itch"}
alert9.addAction(bt15)
let bt16 = UIAlertAction(title: "Burn", style: UIAlertActionStyle.default){
(action) in self.QualityLabel.text = "Burn"}
alert9.addAction(bt16)
let bt17 = UIAlertAction(title: "Abuse", style: UIAlertActionStyle.default){
(action) in self.QualityLabel.text = "Abuse"}
alert9.addAction(bt17)
let bt18 = UIAlertAction(title: "Hemmorhage", style: UIAlertActionStyle.default){
(action) in self.QualityLabel.text = "Hemmorhage"}
alert9.addAction(bt18)
let bt19 = UIAlertAction(title: "Discomfort", style: UIAlertActionStyle.default){
(action) in self.QualityLabel.text = "Discomfort"}
alert9.addAction(bt19)
let bt20 = UIAlertAction(title: "Acute", style: UIAlertActionStyle.default){
(action) in self.QualityLabel.text = "Acute"}
alert9.addAction(bt20)
let bt21 = UIAlertAction(title: "Disease", style: UIAlertActionStyle.default){
(action) in self.QualityLabel.text = "Disease"}
alert9.addAction(bt21)
let bt22 = UIAlertAction(title: "Rash", style: UIAlertActionStyle.default){
(action) in self.QualityLabel.text = "Rash"}
alert9.addAction(bt22)
//Create Cancel Action
let cancel9 = UIAlertAction(title: "CANCEL", style: UIAlertActionStyle.cancel, handler: nil)
alert9.addAction(cancel9)
//Create OK Action
let ok9 = UIAlertAction(title: "INPUT TEXTFIELD", style: UIAlertActionStyle.default) { (action: UIAlertAction) in print("OK")
let textfield = alert9.textFields?[0]
print(textfield?.text!)
self.QualityLabel.text = textfield?.text!
}
alert9.addAction(ok9)
//Add Text Field
alert9.addTextField { (textfield: UITextField) in
textfield.placeholder = "Quality"
}
//Present Alert Controller
self.present(alert9, animated:true, completion: nil)
}
はい、あなたは右、これは、私は、あなたがビューコントローラの先頭に設定される1つ以上のビューコントローラ、テキストフィールドを作成し、非常に醜いと思われているとテキストフィールドの下にテーブルビューを置いて、すべてのボタンテキストをtableviewセル、現在のビューコントローラに設定すると、品質ボタンをタップすると、これは私の考えに最も適しています。 – Vivek