tags:

views:

26

answers:

1

Hi,

I have a text view. I would like to add a 'vertical line' on the left side of the TextView to act as a separator.

Is there a way to do that?

Thank you.

+1  A: 

You could try a custom Drawable background. It would be easier, though, to just create a View for your line:

<View android:layout_width="2dip" android:layout_height="wrap_content" />

and then position it to the left of the TextView, either via a LinearLayout or a RelativeLayout.

CommonsWare
Thanks. My TextView is already in a TableRow which will be 'scretched column. So I can't add a View to the left of my TextView. How can I create a Drawable background with an image to the left of the background?
michael
"So I can't add a View to the left of my TextView." Sure you can. Just wrap the `TextView` and `View` in a `LinearLayout`, and have that be the contents of your stretched column. "How can I create a Drawable background with an image to the left of the background?" You could set up a nine-patch PNG for that: http://developer.android.com/guide/topics/graphics/2d-graphics.html#nine-patch
CommonsWare