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

  • Home
  • SEARCH
  • 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 8883907
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T20:55:58+00:00 2026-06-14T20:55:58+00:00

I want to create a layout for four image button. With two buttons in

  • 0

I want to create a layout for four image button. With two buttons in a row, so that it looks like a cube in the layout. Because I want to support API Level 8 i cannot use grid layout, so I tried it with a combination of LinearLayout.

A root LinearLayout with horizontal orientation, this contains two linearlayout with vertical orientation. These contain my buttons, but i does not work as expected, only one row with two buttons is visible. Can someone help me, thanks

    <?xml version="1.0" encoding="utf-8"?>
    <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
        android:id="@+id/action_screen"
        android:layout_width="fill_parent"
        android:layout_height="fill_parent"
        android:orientation="horizontal" 
        android:paddingTop="30px">

        <LinearLayout 
            android:layout_width="fill_parent"
            android:layout_height="fill_parent"
            android:orientation="horizontal" >

             <ImageButton
                 android:id="@+id/btn_start_cam"
                 android:layout_width="wrap_content"
                 android:layout_height="wrap_content"
                 android:onClick="startCamAction"        
                 android:src="@drawable/photo_button" />

             <ImageButton
                 android:id="@+id/btn_photo_lib"
                 android:layout_width="wrap_content"
                 android:layout_height="wrap_content"
                 android:onClick="startPhotoLibAction"
                 android:src="@drawable/library_blau" />

        </LinearLayout>
        <LinearLayout 
            android:layout_width="fill_parent"
            android:layout_height="fill_parent"
            android:orientation="horizontal" >

             <ImageButton
                 android:id="@+id/btn_start_barcode"
                 android:onClick="startBarcodeAction"
                 android:layout_width="wrap_content"
                 android:layout_height="wrap_content"
                 android:src="@drawable/barcode_blau" />

             <ImageButton
                 android:id="@+id/btn_start_qr_barcode"
                 android:onClick="startQRcodeAction"
                 android:layout_width="wrap_content"
                 android:layout_height="wrap_content"
                 android:src="@drawable/qr_code_blau" />

            </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-06-14T20:55:59+00:00Added an answer on June 14, 2026 at 8:55 pm

    Set the height of the two child LinearLayouts to wrap_content. Otherwise the first LinearLayout will take up the whole height of the parent layout.

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

Sidebar

Related Questions

I want to create one button/layout object dynamically from the object that exist on
I want to create layout like on the image 3 green layouts are linearlayouts
In My application i want to create the layout as like below image: So
I want to create a layout something like shown in image below can anyone
I want to create a layout for an Android app that has a numeric
I want to create a layout that has 6 TextViews on the very top,
I want to create a layout in such a way that on top edittext
I want to create a multicolumn layout in html that will run from left
I want to create a Button otherthan creating it from xml layout.i want to
I want to create a layout in which two bars , one at top

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.