Android: How is a TextView theme so that it looks like an item in a ListView?

I currently have a TextView sitting under the ListView, and would like to place the text in the TextView so that it looks like an item in the list (e.g. with an upper and lower gray border). What is the best way to accomplish this?

0
android
Mar 06 2018-11-11T00:
source share
1 answer

Create a flexible XML file to create a form with a gradient background.

textview_background.xml:

<shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="rectangle"> <gradient android:startColor="#333" android:centerColor="#000" android:endColor="#676" android:angle="270"/> <stroke android:width="2dp" android:color="#80808080"/> </shape> 

save in your directory with a choice and call

  android:background="@drawable/textview_background" 

in your layout for the background of what you want to use. Text view, layout, button ...

This should give you something close to what you are looking for, I think.

The colors used in the gradient are a triple hex, I think you can use a regular hex.

+2
Mar 07 '11 at 1:18
source share



All Articles