【问题标题】:How to set style(small and large) to Button programmable way?如何将样式(小和大)设置为按钮可编程方式?
【发布时间】:2011-05-23 18:45:46
【问题描述】:

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

有可能吗?

我可以将样式设置为来自 xml 资源的按钮(如 styte= ?android:attr/buttonStyleSmall)。 但我不知道如何设置它的可编程方式。

提前致谢。

【问题讨论】:

  • 我正在尝试在运行时更改按钮样式。

标签: android


【解决方案1】:

你可以这样做:

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

【讨论】:

    【解决方案2】:

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

    【讨论】:

      猜你喜欢
      • 2014-09-20
      • 2015-01-09
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2018-03-22
      • 1970-01-01
      相关资源
      最近更新 更多