Reputation: 39
this is my code to draw the rectangle:
<?xml version="1.0" encoding="UTF-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/listview_background_shape" >
<stroke
android:width="5dp"
android:color="#000000" />
<padding
android:bottom="0dp"
android:left="0dp"
android:right="0dp"
android:top="0dp" />
<corners android:radius="0dp" />
<solid android:color="#ffffffff" />
</shape>
then it appears like this:
but that's what i wannt:
can anyone help me with that?
Upvotes: 0
Views: 263
Reputation: 453
Remove padding from your layout file
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:background="@drawable/style"
android:layout_height="match_parent">
</RelativeLayout>
Background
<?xml version="1.0" encoding="UTF-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/listview_background_shape" >
<stroke
android:width="15dp"
android:color="#999999" />
<padding
android:bottom="0dp"
android:left="0dp"
android:right="0dp"
android:top="0dp" />
<corners android:radius="0dp" />
<solid android:color="#ffffffff" />
</shape>
Upvotes: 1