using xml dotted line in android TextView -


i have created xml dotted line explained in how make dotted/dashed line in android?. if use background of textview shows up.

<textview     android:id="@+id/segment"     android:layout_width="match_parent"     android:layout_height="match_parent"     android:background="@drawable/dotted_lines"     android:gravity="left"     android:text="first segment"     android:textsize="12sp" /> 

but if use accompanying drawable, not show up.

<textview     android:id="@+id/segment"     android:layout_width="match_parent"     android:layout_height="match_parent"     android:drawablebottom="@drawable/dotted_lines"     android:gravity="left"     android:text="first segment"     android:textsize="12sp" /> 

essentially, couldn't care less either way, except: need dotted lines appear below text in textview. please help.

use following code make textview dotted line. create file in drawable folder named dotted.xml

<shape xmlns:android="http://schemas.android.com/apk/res/android"        android:shape="rectangle">      <stroke         android:color="#f59c51"         android:width="2dp"         android:dashgap="1dp"         android:dashwidth="2dp"/> </shape> 

then set in background of textview below.

<textview     android:id="@+id/segment"     android:layout_width="wrap_content"     android:layout_height="match_parent"     android:background="@drawable/dotted"     android:gravity="left"     android:text="first segment"     android:textsize="12sp" /> 

Comments

Popular posts from this blog

c++ - Creating new partition disk winapi -

Android Prevent Bluetooth Pairing Dialog -

VBA function to include CDATA -