I have table using table layout. And I have drawable resource for each column. The drawable resource is here.
<shape android:shape= "rectangle">
<solid android:color="@color/white"/>
<stroke android:width="1dp" android:color="@color/red"/>
<size android:width="100dp" android:height="50dp"/>
<padding
android:left="5dp"
android:top="5dp"
android:right="5dp"
android:bottom="5dp" />
</shape>
I used setBackgroundResource()
method. My problem is that I would like to change background color of some columns in run-time depend on the logic. When I use setBackgroundColor
method, the drawable resource for that column has gone. Is there any way to do this? Actually I don't want to create another drawable for that column. This may be second way.