Shape drawable as background, a line at the bottom

前端 未结 7 1278
旧时难觅i
旧时难觅i 2020-12-07 11:58

I am using a drawable as a background of a TextView just to have a divider line below the text. A achivied it with this drawable-xml:



        
相关标签:
7条回答
  • 2020-12-07 13:00

    In general, I try to mess as little as possible with backgrounds unless absolutely necessary, since doing so overrides the default background colors that have states for focused, pressed, etc. I suggest just using an additional view (in a vertical LinearLayout) that is as thick as you need it to be. For example:

     <View 
           android:background="#FF000000" 
           android:layout_height="2dp" 
           android:layout_width="fill_parent"/>
    
    0 讨论(0)
提交回复
热议问题