Java 切换按钮中的曲目文本
请,有人知道我如何在切换按钮的轨道部分设置文本,我需要用java代码而不是xml代码来完成。Java 切换按钮中的曲目文本,java,android,button,Java,Android,Button,请,有人知道我如何在切换按钮的轨道部分设置文本,我需要用java代码而不是xml代码来完成。 假设这是用于Android开关按钮,您可以使用以下选项: //sets text on creation toggleButton.setText(textOff); // Sets the text for when the button off. toggleButton.setTextOff(textOff); // Sets the text for when the button is o
假设这是用于Android开关按钮,您可以使用以下选项:
//sets text on creation
toggleButton.setText(textOff);
// Sets the text for when the button off.
toggleButton.setTextOff(textOff);
// Sets the text for when the button is on.
toggleButton.setTextOn(textOn);
对android来说是的,这个答案是针对拇指文本的,但我正在搜索在切换按钮的轨迹部分添加文本的方法。