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

The Archive Base Latest Questions

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

I want this to work on all screen sizes so I don’t think using

  • 0

I want this to work on all screen sizes so I don’t think using padding is the best way to solve this. I can centre everything when it is in vertical but when it is horizontal nothing seems to align…

<LinearLayout 
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="wrap_content" 
android:orientation = "horizontal"
android:layout_gravity = "center">

<TableLayout
    android:layout_height = "wrap_content"
    android:layout_width="wrap_content"
    android:gravity = "center" 
    android:layout_gravity="center_horizontal">
    <TableRow 
    android:id="@+id/tableRow1" 
    android:layout_width="wrap_content" 
    android:layout_height="wrap_content">
        <TextView 
        android:textSize="24.5sp" 
        android:id="@+id/textView1" 
        android:layout_height="wrap_content" 
        android:gravity="center" 
        android:layout_marginBottom="20dip" 
        android:text="Bubb" 
        android:layout_width="wrap_content">
        </TextView>
    </TableRow>
    <TableRow android:baselineAligned="false">
        <Button
        android:id = "@+id/continue_button"
        android:background="@drawable/and_button" 
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:paddingLeft = "@dimen/pad_horizontal"
        android:paddingRight = "@dimen/pad_horizontal"
        android:paddingTop = "@dimen/pad_vertical"
        android:paddingBottom = "@dimen/pad_vertical"
        android:text = "@string/first_label" 
        android:layout_margin="@dimen/margin"/>
    </TableRow>
    <TableRow>
        <Button
        android:id = "@+id/new_button"
        android:text = "@string/second_label" 
        android:background="@drawable/and_button" 
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:paddingLeft = "@dimen/pad_horizontal"
        android:paddingRight = "@dimen/pad_horizontal"
        android:paddingTop = "@dimen/pad_vertical"
        android:paddingBottom = "@dimen/pad_vertical"
        android:layout_margin="@dimen/margin"/>
    </TableRow>
    <TableRow>
        <Button
        android:id = "@+id/about_button"
        android:text = "@string/third_label" 
        android:background="@drawable/and_button" 
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:paddingLeft = "@dimen/pad_horizontal"
        android:paddingRight = "@dimen/pad_horizontal"
        android:paddingTop = "@dimen/pad_vertical"
        android:paddingBottom = "@dimen/pad_vertical"
        android:layout_margin="@dimen/margin"/>
    </TableRow>
    <TableRow>
        <Button
        android:id = "@+id/exit_button"
        android:text = "@string/fourth_label" 
        android:background="@drawable/and_button" 
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:paddingLeft = "@dimen/pad_horizontal"
        android:paddingRight = "@dimen/pad_horizontal"
        android:paddingTop = "@dimen/pad_vertical"
        android:paddingBottom = "@dimen/pad_vertical"
        android:layout_margin="@dimen/margin"/>
    </TableRow> 
    </TableLayout>

</LinearLayout>

Any help is great.

  • 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-23T07:17:00+00:00Added an answer on May 23, 2026 at 7:17 am

    It’s not clear from your question precisely how you want your layout to look, but I’m guessing (from your XML, at least) that you are after something like this:

    enter image description here

    I don’t have your drawables, so can’t include those.

    If that’s the case, then this layout does the trick:

    <?xml version="1.0" encoding="utf-8"?>
    <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
        android:orientation="vertical" android:layout_width="fill_parent"
        android:layout_height="fill_parent" android:gravity="center">
        <TextView android:text="Bubb" android:layout_width="wrap_content"
            android:layout_height="wrap_content" />
        <Button android:text="Button" android:id="@+id/button1"
            android:layout_width="wrap_content" android:layout_height="wrap_content"></Button>
        <Button android:text="Button" android:id="@+id/button2"
            android:layout_width="wrap_content" android:layout_height="wrap_content"></Button>
        <Button android:text="Button" android:id="@+id/button3"
            android:layout_width="wrap_content" android:layout_height="wrap_content"></Button>
        <Button android:text="Button" android:id="@+id/button4"
            android:layout_width="wrap_content" android:layout_height="wrap_content"></Button>
    </LinearLayout>
    

    EDIT: That aligns in a vertical list when switched to landscape:

    enter image description here

    If you require a horizonal list, simply copy this layout to “res/layout-land” and change the orientation in the outer LinearLayout to “horizontal” :

    <?xml version="1.0" encoding="utf-8"?>
    <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
        android:orientation="horizontal" android:layout_width="fill_parent"
        android:layout_height="fill_parent" android:gravity="center">
    

    and you’ll get 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

Apparently, this does not work. WHY ??????? I don't want to do all this
Why this code don't work,when i want run this code vwd 2008 express show
I want to develop an Android application which can run on all ,screen type
I'm trying to write an application that will work well on all screen sizes,
Is there any chance to get this work? I want my tests to be
Hi: I want to redirect stdout to a NSTextView. Could this also work with
i want to do this simple piece of code work. #include <iostream> #include <windows.h>
I want to match links like <a href=mailto:my@email.com>foo</a> , but this doesn't work only
In FF this border radius doesn't seem to want to work. Editable link here.
This code selects the nodes, I want to work on...: <xsl:variable name=rootTextpageNode select=$currentPage/ancestor-or-self::node [@level

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.