Monday, 11 August 2014

Rectangle's corner border radius is not perfect (Android Shape)



I tried to create a rectangle shape with corner radius and border on android. I almost made it, just a little problem that i cant solve until now :


enter image description here


The border already has some radius on its corner, but the inner rectangle does NOT (please see the red mark on the image).


This is my code :



<shape xmlns:android="http://ift.tt/nIICcg" android:shape="rectangle">
<corners android:radius="10dp"/>
<stroke android:width="3dp" android:color="#000000" />
</shape>


I use this shape by using android:src on the ImageView.


This is how i use the shape :



<ImageView
android:src="@drawable/rectangle"
android:layout_gravity="center"
android:layout_width="wrap_content"
android:layout_height="wrap_content"/>


Please kindly help me out, Thanks.


No comments:

Post a Comment