• After 15+ years, we've made a big change: Android Forums is now Early Bird Club. Learn more here.

Apps Android Rounded Corner Layout with Filled Tiled Image

New Guy5

Lurker
Oct 15, 2014
7
0
I'm hoping there is an xml solution to this... I am trying to create a layout that has rounded corners and then filling that layout with an image (tiled, repeat). So basically I have a LinearLayout that has a drawble layered-list assigned to the background. Here is the test layout (xml):

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:eek:rientation="vertical" >

<LinearLayout
android:id="@+id/rate_buttons"
android:layout_width="100dp"
android:layout_height="50dp"
android:eek:rientation="horizontal"
android:padding="0dp"
android:background="@drawable/test_rounded">
</LinearLayout>
</LinearLayout>

here is the test_rounded drawable xml:

<?xml version="1.0" encoding="utf-8"?>
<layer-list xmlns:android="http://schemas.android.com/apk/res/android" >
<item ><bitmap android:src="@drawable/my_tiled_image" android:tileMode="repeat"/></item>
<item >
<shape xmlns:android="http://schemas.android.com/apk/res/android" >
<stroke android:width="3dip" android:color="#B1BCBE" />
<corners android:radius="20dip"/>
</shape>
</item>
</layer-list>

The image is overflowing at the corners of the shape/layout border. I get the following

9ptcfp.png


corners are overflowed here

As you can see the corners are overflowed. I heard about modifying the image part (blue pattern) in code but I have issues with that since I do modify it and animate it along the way. SO, if its at all possible to just fill in the layout with that image, please let me know. Thank you all for your help.
 

BEST TECH IN 2023

We've been tracking upcoming products and ranking the best tech since 2007. Thanks for trusting our opinion: we get rewarded through affiliate links that earn us a commission and we invite you to learn more about us.

Smartphones