0
我有一个问题。我制作了一个简单的文字和按钮应用程序。当我触摸按钮并告诉它更改标签中的文本时,文本会重叠。UILabel在xcode 6中重叠文字
我做了一个简单的应用程序,在UILabel
中显示“hello Phylicia”,当按下按钮时,它应该变成“你好吗”。我如何让文字改变?
我在这里使用此设置:
import UIKit
class ViewController: UIViewController {
@IBOutlet weak var funFactLabel: UILabel!
override func viewDidLoad() {
super.viewDidLoad()
// Do any additional setup after loading the view, typically from a nib.
}
override func didReceiveMemoryWarning() {
super.didReceiveMemoryWarning()
// Dispose of any resources that can be recreated.
}
@IBAction func showFunFact() {
funFactLabel.text = "How are you"
}
}
您的代码看起来正确。你是什么意思,“标签中的文字与文本重叠”?你可以在行动中发布问题的截图,也许你的故事板看起来像什么? – 2014-11-02 18:07:40