改變textappearance動態添加的行的介質上點擊按鈕BTN1一排是added.I希望其文本外觀改變爲MEDIUM於表佈局分鐘API 17
ERROR-setTextAppearance不能應用於
btn1.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
TableRow row1 = new TableRow(create_form.this);
TextView txt1 = new TextView(create_form.this);
EditText edttxt1 = new EditText(create_form.this);
txt1.setText("Topic");
txt1.setTextColor(Color.parseColor("#000000"));
txt1.setTextAppearance(android.R.style.TextAppearance_Medium);**//ERROR ,NOT WORKING**,Call requires API level23(current min is 17)
row1.addView(txt1);
row1.addView(edttxt1);
t1.addView(row1);
}
}
});
這是說錯了第一個argumnet類型爲txt1.setTextAppearance(this,android.R.style.TextAppearance_Medium); –
txt1.setTextAppearance(android.R.style.TextAppearance_Medium);關於使用此應用程序崩潰的按鈕,請點擊 –
您遇到應用程序崩潰有哪些例外情況? –