Pregunta

I have severals line which indent a little bit, each line may span to next line if it is too long. I wish to have the left [padding] space to be white background while the background of real text be yellow say. The gap between 2 [padding] needs also to be white.
Essentially, the left space of the real text have different background with the text. How do i do it ?

[padding]Line1 .......................
         ............continue of Line1
[padding]Line2

thank you

¿Fue útil?

Solución

Use something like this:

<LinearLayout
  ...
  android:background="#fff"
  android:orientation="vertical">

    <TextView
        ...
        android:layout_marginLeft="4dp"
        android:background="#ffff00"/>

    <TextView
        ...
        android:layout_marginLeft="4dp"
        android:background="#ffff00"/>

</LinearLayout>
Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top