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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T02:38:45+00:00 2026-05-31T02:38:45+00:00

I’ve spent a long time working on layout issues and screen sizes. I’ve read

  • 0

I’ve spent a long time working on layout issues and screen sizes. I’ve read through the Android document here, which has helped and makes total sense:
http://developer.android.com/guide/practices/screens_support.html

So, now I have my app showing exactly the same size on different screen sizes, as all of my elements throughout use DIP ( Density independant pixels ).

However, I have two devices infront of me, one larger than the other, so what that means is some empty space at the bottom of the larger screen size ( Sensation XE ) than on the slightly smaller screen size ( Desire Z ).

Reading the Android document, the general solution is to create layouts for xlarge, large, normal and small screen sizes that have a different number of DIP.

That’s great, but with the layout I have which is awfully complex ( lots of custom views, lots of buttons, 3 text views, lots of images that are seperate so they can light up ), it’s a lot of work to recreate those layouts.

The layout however, would be ok if it was stretched. If it took how it looks on for example the Desire Z, and literally just stretched everything to fit the larger screen, that would be fine as stretching here shouldn’t be a big problem.

My question is, is there a way to do that without having to re-create the layout 4 times?
Yes I realize I can copy paste most of it, but it would be really handy to just stretch what I have.

I tested on a tablet device, and it showed well but everything was tiny and didn’t fill the screen. I have different sized images in the different folders ( xhdpi through to ldpi ), so it picking the correct image shouldn’t be an issue.

Thanks, any help is much much appreciated.

  • 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-05-31T02:38:46+00:00Added an answer on May 31, 2026 at 2:38 am

    Yes, in general you can stretch things to fit your layout using fill_parent for android:layout_width and/or android:layout_height on certain widgets. You can also scale proportionally by setting layout_weight appropriately for a series of widgets in a LinearLayout. How to do it really just depends on what you want to do, and is very difficult to answer in the abstract. If you have an example and a question about how to do something in particular, that might be easier to answer.

    Here’s an example of a RelativeLayout that uses fill_parent to handle different screen sizes:

    <?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:orientation="vertical" >
        <TextView 
            android:id="@+id/first"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:background="#ff880000"
            android:text="Some text" />
        <TextView 
            android:id="@+id/second"
            android:layout_width="fill_parent"
            android:layout_height="wrap_content"
            android:layout_alignBaseline="@id/first"
            android:layout_toRightOf="@id/first"
            android:background="#ff008800"
            android:text = "More text" />
        <TextView 
            android:id="@+id/third"
            android:layout_width="fill_parent"
            android:layout_height="wrap_content"
            android:layout_below="@id/first"
            android:background="#ff000088"
            android:text="Even more text" />
        <TextView 
            android:id="@+id/fourth"
            android:layout_width="fill_parent"
            android:layout_height="fill_parent"
            android:layout_below="@id/third"
            android:background="#ff008888"
            android:text="The last text" />
        </RelativeLayout>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

link Im having trouble converting the html entites into html characters, (&# 8217;) i
I am trying to understand how to use SyndicationItem to display feed which is
I used javascript for loading a picture on my website depending on which small
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I would like to run a str_replace or preg_replace which looks for certain words
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
I have a text area in my form which accepts all possible characters from
I'm trying to decode HTML entries from here NYTimes.com and I cannot figure out
I'm working with an upstream system that sometimes sends me text destined for HTML/XML
I am trying to loop through a bunch of documents I have to put

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.