小编Hac*_*fes的帖子

如何在swift label.text中添加新行

我正在创建一个应用程序,我想在Teach.text中添加一个新行

func RandomQuestions(){

        var RandomNumber = arc4random() % 1
        RandomNumber += 1

        switch(RandomNumber){
        case 1:
            QuestionLbl.hidden = false
           QuestionLbl.text = "2x + 4 = 14"
            Button1.setTitle("x = 5", forState: UIControlState.Normal)
           Button2.setTitle("x = 4", forState: UIControlState.Normal)
           Button3.setTitle("x = 9", forState: UIControlState.Normal)
            Button4.setTitle("y = 5", forState: UIControlState.Normal)
            Teach.text = "2x + 4 = 14"
            CorrectAnswer = "1"
            break

        default:
            break

        } 

    }
Run Code Online (Sandbox Code Playgroud)

所以换句话说,我需要添加另一行,所以当我测试我的应用时,'教'应该说

2x + 4 = 14
2x = 10

swift

5
推荐指数
1
解决办法
2万
查看次数

标签 统计

swift ×1