我正在尝试找到一种方法来更改 Android 库的背景,例如: 1.排深灰色; 2.排灰色; 3.排深灰色; 4.排灰等
但是没有用。
我试过:
if(mIndexController%2 ==1){
itemContainer.setBackgroundColor(R.color.grey);
viewsContainer.setBackgroundColor(R.color.grey);
}
else{
itemContainer.setBackgroundColor(R.color.darkgrey);
viewsContainer.setBackgroundColor(R.color.darkgrey);
}
在库 UITableView Activity 中,但它不工作。
有人可以帮我吗?
这是图书馆: https://github.com/thiagolocatelli/android-uitableview
我希望 ListView 看起来像这样: http://i.stack.imgur.com/Ls5bG.png
最佳答案
事实上 viewsContainer.setBackgroundColor(R.color.grey);
什么都不做。
你应该像这样更正它:
viewsContainer.setBackgroundColor(getResources().getColor(R.color.grey));
关于android - 更改 Android UI 表库中的背景(thiagolocatelli),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10287916/