【发布时间】:2012-10-30 05:28:30
【问题描述】:
我希望以编程方式使用 android 代码更改按钮背景颜色、文本颜色、文本大小。
Button btnLoadMore = new Button(this);
btnLoadMore.setText("Load More");
// Adding Load More button to lisview at bottom
lv.addFooterView(btnLoadMore);
在上面的代码中成功设置了加载更多文本。但我必须写在下面的行
btnLoadMore.setTextColor("#FF1493");
表示出现以下错误
The method setTextColor(int) in the type TextView is not applicable for the arguments
(字符串)
我该如何解决这个错误。请帮助我。
【问题讨论】:
-
this的可能重复
-
感谢您提供这么好的主意....我必须使用以下行更改背景:btnLoadMore.setBackgroundResource(R.drawable.lgnbttn);
标签: android android-layout android-button