Ich versuche, Text auf die Größe eines UILabel
einzustellen und auch zentriert werden. Ich mache das programmatisch. Dies ist, was es sieht aus wie zur Zeit:Einstellung Text auf die Größe eines UILabel und der Mitte in SWIFT
Wie Sie sehen können, wird der Text auf den Bildschirm geht aus und wird auch nicht zentriert.
Dies ist mein Code:
let questions = "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec ac faucibus tellus."
questionsLabel = UILabel(frame: CGRectMake(10, 10, questionsView.frame.size.width - 20, 80))
questionsLabel.text = questions
questionsLabel.font = UIFont(name: Font.FuturaMedium, size: 25)
questionsLabel.sizeToFit()
questionsLabel.numberOfLines = 0
questionsLabel.textAlignment = NSTextAlignment.Center
questionsView.addSubview(questionsLabel)
Was mache ich falsch?