0

I'm having a textview and its background is set using drawable resource.

<TextView
         android:id="@+id/label1"
         android:layout_width="wrap_content"
         android:layout_height="wrap_content"
         android:text="Label1"
         android:textColor="#FFFFFF"
         android:background="@drawable/rounded_label"
         android:layout_below="@id/snippet"
         android:layout_toRightOf="@id/label"
         android:layout_alignParentBottom="true"
         >

rounded_label.xml

<?xml version="1.0" encoding="utf-8"?>
<shape
  xmlns:android="http://schemas.android.com/apk/res/android">
    <solid android:color="#000000"/>
    <corners android:radius="3px"/>
    <padding android:left="0dp"
        android:top="0dp" android:right="0dp" 
         android:bottom="dp" />
</shape>

The color assigned in <solid> must be performed in runtime using code not using XML?

Thanks in advance.

siva
  • 1,429
  • 3
  • 26
  • 47

1 Answers1

-1

You have missing

android:bottom="10dp"

padding value please fix this value. or try this.

And other things , You have wrong color settings, you must specify 4 byte colors,

eg: #FFFF0000

<shape xmlns:android="http://schemas.android.com/apk/res/android">
       <solid android:color="#f0600000"/>
       <stroke android:width="3dp" color="#ffff8080"/>
       <corners android:radius="3dp" />
       <padding android:left="10dp" android:top="10dp"
          android:right="10dp" android:bottom="10dp" />
 </shape>
Horrorgoogle
  • 7,858
  • 11
  • 48
  • 81