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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T23:23:16+00:00 2026-05-31T23:23:16+00:00

I am having three images or buttons in a linear layout which fits fine

  • 0

I am having three images or buttons in a linear layout which fits fine on large devices, but when it comes to small devices, what should i do so that the third image comes in the next line (in small devices, it would be aligned properly in landscape but it would go out of the screen in the portrait mode).

enter image description here

XML code:

        <LinearLayout
            android:id="@+id/linearLayout7"
            android:layout_width="fill_parent"
            android:layout_height="wrap_content" android:layout_marginLeft="5dp" android:layout_marginRight="5dp" android:layout_marginBottom="5dp" android:gravity="left" android:layout_gravity="left" android:fitsSystemWindows="true">

            <ImageButton
                android:id="@+id/stopServiceButton"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:src="@drawable/stop_service_button_selector" android:background="@null" android:layout_gravity="left" android:paddingBottom="5dp" android:paddingRight="5dp" android:paddingTop="5dp"/>

            <ImageButton
                android:id="@+id/calibrateButton"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:src="@drawable/calibrate_button_selector" android:background="@null" android:layout_gravity="left" android:padding="5dp"/>

            <ImageButton
                android:id="@+id/doneButton"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:src="@drawable/done_button_selector" android:background="@null" android:layout_gravity="left" android:padding="5dp"/>

        </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-31T23:23:17+00:00Added an answer on May 31, 2026 at 11:23 pm

    One simple way is to use layout_weight attribute,this way

        <LinearLayout 
            android:id="@+id/linearLayout7" 
            android:layout_width="fill_parent" 
            android:weight_sum="3"
            android:layout_height="wrap_content" android:layout_marginLeft="5dp" android:layout_marginRight="5dp" android:layout_marginBottom="5dp" android:gravity="left" android:layout_gravity="left" android:fitsSystemWindows="true"> 
    
            <ImageButton 
                android:id="@+id/stopServiceButton" 
                android:layout_weight="1"
                android:layout_width="0dp" 
                android:layout_height="wrap_content" 
                android:src="@drawable/stop_service_button_selector" android:background="@null" android:layout_gravity="left" android:paddingBottom="5dp" android:paddingRight="5dp" android:paddingTop="5dp"/> 
    
            <ImageButton 
                android:id="@+id/calibrateButton" 
                android:layout_weight="1"
                android:layout_width="0dp"
                android:layout_height="wrap_content" 
                android:src="@drawable/calibrate_button_selector" android:background="@null" android:layout_gravity="left" android:padding="5dp"/> 
    
            <ImageButton 
                android:id="@+id/doneButton" 
                android:layout_weight="1"
                android:layout_width="0dp"
                android:layout_height="wrap_content" 
                android:src="@drawable/done_button_selector" android:background="@null" android:layout_gravity="left" android:padding="5dp"/> 
    
        </LinearLayout> 
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Hey guys I am having trouble with placing my buttons in my XML layout.
I my application i am having three links, on clicking the link i need
I'm having some trouble using constraints correctly. I have three tables, 'item', 'store' and
I have a universal iOS app with a custom view that has three buttons,
I am having problem when making a long scroll view with images. It will
I am having issues with ie 8 compatibility mode. I have some buttons that
I have recently started looking into using Azure but I'm having some issues getting
I want to place three button images of same size equal to screen it
Image shows the buttons on my UI in vb.net All these buttons are having
I'm struggling to finish my Android app, but I'm having some problems with the

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.