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 8428053
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T04:56:54+00:00 2026-06-10T04:56:54+00:00

I’m having quite a hard time with a textured background. I have a 60px

  • 0

I’m having quite a hard time with a textured background. I have a 60px by 60px bitmap texture that I want to set as the background for my layout in a repeated tile pattern. Here’s the layout xml located in res/layout:

<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout
    xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    android:background="@drawable/dark_texture_background" >

    ...
</RelativeLayout

And here is the dark_texture_background, located in res/drawable:

<?xml version="1.0" encoding="utf-8"?>
<bitmap xmlns:android="http://schemas.android.com/apk/res/android"
    android:src="@drawable/dark_background_texture"
    android:tileMode="repeat" />

The dark_background_texture is the 60×60 pixel image.

So, the issue is that the texture image is being enlarged while also being tiled. I added a red line to the outside of the texture image to see exactly where the texture images were, and here’s the result:

Tiled Background

I also added the screen height, width and density according to getResources().getDisplayMetrics().

Since the screen width is 480 pixels, the texture image should be repeated 8 times across (480 / 60 = 8). Instead, there are only 5 ~1/4. The image is now ~90 pixels and tiled. WTF?

Why is my texture image being stretched when I explicitly tell it to repeat?

  • 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-10T04:56:56+00:00Added an answer on June 10, 2026 at 4:56 am

    I’m not sure what Raghav’s referring to with the bug, exactly, but if they’ve changed something in ICS+ then there was certainly something wrong. That said, I’m fairly certain that bitmap images in drawable are assumed to be mdpi, and scaled from there (maybe they changed that behavior?), which makes sense given that your 60px image became 90px (60 * 1.5 scaling factor).

    You can avoid scaling altogether, keeping in mind that the physical size will differ on different densities (although for a tiled background it’s probably not important), by placing your bitmaps into a drawable-nodpi folder only. Android will use those drawables without scaling, regardless of density.

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

Sidebar

Related Questions

I have a French site that I want to parse, but am running into
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
I have a .ini file as follows: [playlist] numberofentries=2 File1=http://87.230.82.17:80 Title1=(#1 - 365/1400) Example
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I have just tried to save a simple *.rtf file with some websites and
I want to count how many characters a certain string has in PHP, but
I have a jquery bug and I've been looking for hours now, I can't
this is what i have right now Drawing an RSS feed into the php,

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.