我有一個textview,我想在正常的TextSize中顯示0.0,然後以較小的文本大小顯示StringResult()。Html.fromHtml無法正常工作
如果我添加「0.0」+它不起作用。爲什麼?
public String StringResult(){
String displayLbl = this.getResources().getString(R.string.displayLbl);
TextView myUnitLbl = (TextView)findViewById(R.id.lbl_unit_res);
String myFinalLbl = displayLbl + " " + myUnitLbl.getText() + " ";
return myFinalLbl;
}
public void cmd_rst(View v){
TextView lblText = (TextView) findViewById(R.id.lblresult);
lblText.setText("0.0" + Html.fromHtml("<small>" + StringResult() + "</small>"));
}
'lblText.setText(Html.fromHtml(「」+ StringResult()+「」)); //只有這樣才行' – dunrad