在我的Android應用程序..一個數由用戶輸入在不同條件下分配不同的顏色相同的TextView和我的應用程序告訴數量是否是在一個TextView整數或浮點數類型號的..! 我面臨的問題是,我要顯示整型數和綠色浮法.. 應該是什麼這樣的代碼中的紅色TextView的。我們怎樣才能像使用的EditText .. 如果...在其他的Android
的的if..else條件碼我要的是想象這樣的:
TextView tv = (TextView) findViewById(R.id.my_text_view);
if (number= interger)
{
tv.setText("integer number");
// and the color of this TextView will be RED
}
else
{
tv.setText(Float number);
// and the color of this TextView will be GREEN
}
謝謝。