I created a 9patch image and somehow it does only stretch vertically.
I tried other 9-patch images, but they have the same effect, whyle they work in other situations. So the 9patch should be fine I think.
This is my XML code:
..
<ImageView
android:id="@+id/bottombar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:contentDescription="@string/app_name"
android:src="@drawable/bar" />
</RelativeLayout>
Anybody had the same issue and know how to solve it?
Thanks
If you are sure that the
heightof yourViewis really taller than the currentimage(as the others have suggested) then you should change yourImageViewsscaleType. The default isFIT_CENTERwhich does not stretch the image, you should set it toFIT_XY.Also you may try to set your 9-png file as the background of your
ImageViewnot as thesrcand I think this will also stretch the file.