eld*_*his 46
您可以使用该setText()方法.例:
import android.widget.Button;
Button p1_button = (Button)findViewById(R.id.Player1);
p1_button.setText("Some text");
Run Code Online (Sandbox Code Playgroud)
另外,作为参考点,Button扩展了TextView,因此您可以setText()像使用普通的TextView一样使用它.
Ska*_*one 20
我能够像这样更改按钮的文本:
import android.widget.RemoteViews;
//grab the layout, then set the text of the Button called R.id.Counter:
RemoteViews remoteViews = new RemoteViews(getPackageName(), R.layout.my_layout);
remoteViews.setTextViewText(R.id.Counter, "Set button text here");
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
116011 次 |
| 最近记录: |