i want to create a table with multiple row with each row having differnet color . I have inserted textView in each row and changed its background accordingly .
my xml is
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://ift.tt/nIICcg"
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:gravity="center_horizontal">
<TableLayout
style="@style/TableLayout"
android:id="@+id/table_layout">
<TableRow>
<TextView
android:id="@+id/text_view4"
android:text="sd"
android:layout_width="200dp"
android:layout_height="50dp"
android:background="#0FFFF000"
/>
</TableRow>
<TableRow >
<TextView
android:id="@+id/text_view3"
android:text="ds"
android:layout_width="200dp"
android:layout_height="50dp"
android:background="#0700k000"/>
/>
</TableRow>
<TableRow>
<TextView
android:id="@+id/text_view2"
android:text="ds"
android:layout_width="200dp"
android:layout_height="50dp"
android:background="#0700F000"
/>
</TableRow>
<TableRow>
<TextView
android:id="@+id/text_view1"
android:text="ds"
android:layout_width="200dp"
android:layout_height="50dp"
android:background="#07000000"/>
/>
</TableRow>
</TableLayout>
</RelativeLayout>
how do i change the background color dynamically in java?
No comments:
Post a Comment