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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T22:40:40+00:00 2026-05-29T22:40:40+00:00

I have a problems with my layout_margin. I want to make my layout look

  • 0

I have a problems with my layout_margin. I want to make my layout look like that:

image 1

(with “a” is margin)

My problems is, when i build my layout in other screen size, it look like that:

image 2

How can i make it beautiful with different screen size? This is my layout:

<LinearLayout
            android:id="@+id/footer_result_layout"
            android:layout_width="fill_parent"
            android:layout_height="wrap_content"
            android:gravity="center"
            android:orientation="vertical"
            android:visibility="gone" >

            <LinearLayout
                android:layout_width="fill_parent"
                android:layout_height="0dp"
                android:layout_gravity="center"
                android:layout_weight="1"
                android:gravity="center"
                android:orientation="horizontal" >

                <ImageView
                    android:id="@+id/btn_recommendtion"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                     android:adjustViewBounds="true"
                    android:src="@drawable/coodinate" />
            </LinearLayout>

            <LinearLayout
                android:layout_width="fill_parent"
                android:layout_height="0dp"
                android:layout_gravity="center"
                android:layout_marginTop="20dip"
                android:layout_weight="1"
                android:gravity="center"
                android:orientation="horizontal" >

                <ImageView
                    android:id="@+id/btn_facebook"
                    android:layout_width="0dp"
                    android:layout_height="fill_parent"
                    android:layout_margin="5dip"
                    android:layout_weight="1"
                    android:adjustViewBounds="true"
                    android:src="@drawable/fb" />

                <ImageView
                    android:id="@+id/btn_mixi"
                    android:layout_width="0dp"
                    android:layout_height="fill_parent"
                    android:layout_margin="5dip"
                    android:layout_weight="1"
                    android:adjustViewBounds="true"
                    android:src="@drawable/mixi" />
            </LinearLayout>
        </LinearLayout>
  • 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-29T22:40:41+00:00Added an answer on May 29, 2026 at 10:40 pm

    Try using a relative layout.
    Here is an example using buttons. You can swap out the values of the buttons with your image views, and adjust your margins as needed. This should center the buttons, with the same margins on any screen.

    <Button
        android:id="@+id/btn_1"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:adjustViewBounds="true"
        android:text="BUTTON 1" 
         android:layout_centerHorizontal="true"/>
    
    <LinearLayout
        android:layout_height="wrap_content"
        android:layout_width="wrap_content"        
        android:layout_below="@+id/btn_1"
        android:layout_centerHorizontal="true"
        android:layout_marginTop="5dip"
        android:orientation="horizontal" >
    
        <Button
            android:id="@+id/btn_2"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:adjustViewBounds="true"
            android:layout_margin="5dip"
            android:text="BUTTON 2" />
    
        <Button
            android:id="@+id/btn_3"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:adjustViewBounds="true"
            android:layout_margin="5dip"
            android:text="BUTTON 3" />
    
    
    </LinearLayout>
    

    It looks like this:

    enter image description here

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

Sidebar

Related Questions

I have problems getting some of my views aligned in a relative layout that
I'm trying to build a UI layout in WPF that can scale with the
I am build a page,however I meet some layout related probelms,I can not make
I have a problem with GridBagLayout. My components doesnt want to look like i
I have read about problems that onClickListener will consume onItemClickListener Events like here or
I have to make a simple layout in android but have problem with the
I have a reasonably complex layout problem: I would like to have a main
I have a layout that is working, but it has one very annoying problem..
I have a problem with my layout. I have a content div that I
I have a similar problem as CSS Auto Margin pushing down other elements :

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.