Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/symfony/6.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Android 如何将样式(大小)设置为按钮可编程方式?_Android - Fatal编程技术网

Android 如何将样式(大小)设置为按钮可编程方式?

Android 如何将样式(大小)设置为按钮可编程方式?,android,Android,如何将样式(大小)设置为按钮可编程方式 可能吗 我可以从xml资源中将样式设置为按钮(比如styte=?android:attr/buttonStyleSmall)。 但我不知道该怎么设置 提前谢谢 很抱歉,您不能在运行时修改样式。您可以这样做: Button button = new Button(this, null, android.R.attr.buttonStyleSmall); 我试图在运行时更改按钮样式。

如何将样式(大小)设置为按钮可编程方式

可能吗

我可以从xml资源中将样式设置为按钮(比如styte=?android:attr/buttonStyleSmall)。 但我不知道该怎么设置


提前谢谢

很抱歉,您不能在运行时修改样式。

您可以这样做:

Button button = new Button(this, null, android.R.attr.buttonStyleSmall);

我试图在运行时更改按钮样式。