I have an image that I want to repeat on the x axis so that it matches the width.
repeating_section_header.xml:
<?xml version="1.0" encoding="utf-8"?> <bitmap xmlns:android="http://schemas.android.com/apk/res/android" android:src="@drawable/table_section_header_light" android:tileMode="repeat" />
so far so good. Now I set this as the background of the TextView
:
<TextView xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/row_headline_text" android:layout_width="match_parent" android:layout_height="wrap_content" android:background="@drawable/repeating_section_header" android:gravity="left|center_vertical" android:textColor="@color/white" android:textSize="14sp" android:textStyle="bold"/>
But now the height of the TextViews is the height of @drawable/table_section_header_light
, even if I set the height of the TextViews to wrap_content
.
Think about how to fix it (make the TextViews height to wrap the content)
source share