Using tabulator / tabspace in a TextView

前端 未结 3 431
南笙
南笙 2020-12-29 05:42

I wish to use some tabspace in a line where I call setText

if(id==R.id.radioButton1){
            title.setText(numbertext.getText()+\" Grams\");
         


        
3条回答
  •  旧巷少年郎
    2020-12-29 06:06

    If "\t" doesn't work and \u0009 (Unicode for a tab) only shows 1 space:

    In values/strings.xml add

    \u0009\u0009\u0009\u0009
    

    Then in your Java file add

    textView.setText("text" + getString(R.string.tab) + "moretext");
    

提交回复
热议问题