Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7755043
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T12:28:04+00:00 2026-06-01T12:28:04+00:00

For a linearLayout, I want to have a gradient along with a tiled (repeated)

  • 0

For a linearLayout, I want to have a gradient along with a tiled (repeated) image in the background. I already have a shape xml set as the background

<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
    android:shape="rectangle">
    <gradient android:angle="90"
        android:endColor="@color/color1"
        android:startColor="@:color/color2">
    </gradient>
</shape>

How do I add a tiled bg image?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-01T12:28:06+00:00Added an answer on June 1, 2026 at 12:28 pm

    Check out LayerLists.

    The following is an XML drawable, called myBackground.xml, placed in res/drawable.
    Set it as the background of the View you want to set a gradient and tiled background for.

    In the example below, the tiled image will be on top of the gradient, because it is specified later in the LayerList – obviously if it’s on top, you’ll need some transparency on the png image tile (you can set this in an image editing application, like GIMP or Photoshop).

    <?xml version="1.0" encoding="utf-8"?>
    <layer-list xmlns:android="http://schemas.android.com/apk/res/android">
        <item>
            <shape android:shape="rectangle">
                <gradient
                    android:type="radial" android:gradientRadius="500"
                    android:startColor="#17568A"
                    android:endColor="#494C4F" />  
    
            </shape>
        </item>
        <item>
            <bitmap
                android:src="@drawable/tile_classy_fabric"
                android:tileMode="repeat" />
        </item>
    </layer-list>
    

    “tile_classy_fabric” refers to a file called “tile_classy_fabric.png” in my res/drawable folder (250px square, as it’s tileable – we don’t need it super large).

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I use the following main.xml for my app. <?xml version=1.0 encoding=utf-8?> <LinearLayout xmlns:android=http://schemas.android.com/apk/res/android android:layout_width=fill_parent
I have a image used for a LinearLayout background Let's say image has 20x100
I have a LinearLayout view that already contains several elements. I want to add
How can I position a radial gradient shape as background in a LinearLayout ?
Say I have a LinearLayout with some elements in it as an .xml file.
i have many views (textview) in linearlayout i want each view id when i
I want to have a grid type layout of image views. To begin i
I have a LinearLayout that I am extending and I want to add a
H have multiple TextViews inside an LinearLayout . Now I want to delete this
I have an xml file right now which has a TableLayout within a LinearLayout.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.