你好:)我试图让我的游戏类型:
当前得分:X
In:Y秒 (在他们之间,跳过一条线。) 这是我尝试使用的代码:
changingTextView.setText("current score:"+counter+ \n- +"in"+TimeCounter+"seconds");
\ n或/ n对我不起作用.. 我也尝试过:
changingTextView.setText("current score:"+counter+ <br> +"in"+TimeCounter+"seconds");
它也不起作用..
答案 0 :(得分:2)
试试这个:
changingTextView.setText("current score:"+counter+ System.getProperty("line.separator") +"in"+TimeCounter+"seconds");
答案 1 :(得分:0)
尝试<br>
作为
changingTextView.setText(Html.fromHtml("current score:"+counter+ "<br>" +"in"+TimeCounter+"seconds"));
并确保你的\ n在&#34; \ n&#34;它的工作原理。
changingTextView.setText("current score:"+counter+ "\n" + "-" +"in"+TimeCounter+"seconds");