programmatically set edit text hint in android?

后端 未结 8 1453
再見小時候
再見小時候 2020-12-09 14:39

is there a way to set the text hint displayed inside of an android edittext with java? I would like for my app to be able to display different things in the edittext at diff

8条回答
  •  轻奢々
    轻奢々 (楼主)
    2020-12-09 15:16

    You can try following,

    in Java

    yourEditText.setHint("hint");
    

    in Kotlin

    yourEditText.hint = "Your hint"
    

提交回复
热议问题