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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T16:14:43+00:00 2026-05-26T16:14:43+00:00

I started writing a super-simple text adventure game a few months ago, and I

  • 0

I started writing a super-simple text adventure game a few months ago, and I am just now getting back to it. But after looking at the layout, I now think it’s really ugly.

I’m really new to this whole XML layout format, and I was wondering if someone could take a look at this for me and let me know if there’s a better, more attractive way of writing this layout.

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="fill_parent" android:layout_height="fill_parent">

<TableLayout android:stretchColumns="*" 
     android:layout_height="wrap_content" 
     android:id="@+id/tableLayout1" 
     android:layout_width="fill_parent">

        <TableRow 
            android:layout_height="wrap_content" 
            android:id="@+id/tableRow1" 
            android:layout_weight="1" 
            android:layout_width="fill_parent" 
            android:gravity="center">  

            <TextView android:text="" 
                android:id="@+id/introText" 
                android:layout_height="wrap_content" 
                android:layout_width="wrap_content" 
                android:layout_marginLeft="2dip" 
                android:layout_marginRight="2dip" 
                android:layout_marginTop="2dip" 
                android:layout_marginBottom="2dip">
            </TextView>
        </TableRow>

        <TableRow 
            android:layout_height="wrap_content" 
            android:id="@+id/tableRow1" 
            android:layout_weight="1" 
            android:layout_width="fill_parent" 
            android:gravity="center">

            <TextView android:text="navigationText" 
                android:id="@+id/navigationText" 
                android:layout_width="wrap_content" 
                android:layout_height="wrap_content" 
                android:layout_margin="2dip"/>

            <TextView android:text="actionText" 
                android:id="@+id/actionText" 
                android:layout_width="wrap_content" 
                android:layout_height="wrap_content" 
                android:layout_margin="2dip"/>

            <TextView android:text="encounterText" 
                android:id="@+id/encounterText" 
                android:layout_width="wrap_content" 
                android:layout_height="wrap_content" 
                android:layout_margin="2dip" 
                android:layout_marginBottom="1dip"/>
        </TableRow>
</TableLayout>  

<TableLayout android:stretchColumns="*" 
     android:layout_height="wrap_content" 
     android:id="@+id/tableLayout1" 
     android:layout_width="fill_parent">
    <TableRow 
        android:layout_height="wrap_content" 
        android:id="@+id/tableRow1a" 
        android:layout_weight="1" 
        android:layout_width="fill_parent" 
        android:gravity="left">    

        <TextView android:text="characterInfo" 
            android:id="@+id/charText" 
            android:layout_width="wrap_content" 
            android:layout_height="wrap_content" 
            android:layout_margin="2dip">
        </TextView>
        <TextView android:text="" android:id="@+id/textView1" 
android:layout_width="wrap_content"
android:layout_height="wrap_content">
</TextView> 

        <Button android:text="North" 
            android:id="@+id/btnNorth" 
            android:layout_height="wrap_content" 
            android:layout_width="fill_parent" android:layout_margin="2dip">
        </Button>
    </TableRow>

    <TableRow 
        android:layout_width="wrap_content" 
        android:layout_height="wrap_content" 
        android:id="@+id/tableRow2" 
        android:gravity="left">

        <TextView android:text="statsText" 
            android:id="@+id/statsText" 
            android:layout_width="wrap_content" 
            android:layout_height="wrap_content" 
            android:maxLines="5"
            android:layout_margin="2dip">
        </TextView> 

        <Button android:text="West" 
            android:id="@+id/btnWest" 
            android:layout_width="wrap_content" 
            android:layout_height="wrap_content" 
            android:layout_marginLeft="32dip" android:layout_marginRight="2dip"
 android:layout_marginTop="2dip" android:layout_marginBottom="2dip">
        </Button>
        <Button
            android:text="i" 
            android:id="@+id/btnInventory" 
            android:layout_width="wrap_content" 
            android:layout_height="wrap_content" android:layout_marginLeft="10dip" 
android:layout_marginRight="10dip" android:layout_marginTop="2dip" 
android:layout_marginBottom="2dip">
        </Button>
        <Button 
            android:text="East" 
            android:id="@+id/btnEast" 
            android:layout_width="wrap_content" 
            android:layout_height="wrap_content" 
            android:layout_marginLeft="2dip" android:layout_marginRight="32dip" 
android:layout_marginTop="2dip" android:layout_marginBottom="2dip">
        </Button>
    </TableRow>

    <TableRow 
        android:layout_width="wrap_content" 
        android:layout_height="wrap_content" 
        android:id="@+id/tableRow3" 
        android:gravity="left">

        <TextView android:text="itemsText" 
            android:id="@+id/itemsText" 
            android:layout_width="wrap_content" 
            android:layout_height="wrap_content" 
            android:layout_margin="2dip">
        </TextView>
        <TextView android:text="" android:id="@+id/textView2" 
android:layout_width="wrap_content" android:layout_height="wrap_content"></TextView>    
        <Button android:text="South" 
            android:id="@+id/btnSouth" 
            android:layout_width="wrap_content" 
            android:layout_height="wrap_content" 
            android:layout_margin="2dip">
        </Button>
    </TableRow>
    <TableRow
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:id="@+id/tableRow4"
        android:gravity="center">
        <TextView android:text="" android:id="@+id/textView3" 
android:layout_width="wrap_content" android:layout_height="wrap_content"></TextView>
        <Button android:text="Attack" android:id="@+id/btnFight" 
android:layout_height="wrap_content" android:layout_width="wrap_content" 
android:layout_marginLeft="15dip" android:layout_marginRight="10dip" 
android:layout_marginTop="2dip"></Button>
        <Button android:text="Flee" android:id="@+id/btnRun" 
android:layout_width="wrap_content" android:layout_height="wrap_content" 
android:layout_marginLeft="10dip" android:layout_marginRight="10dip" 
android:layout_marginTop="2dip"></Button>
        <Button android:text="Search" android:id="@+id/btnSearch" 
android:layout_width="wrap_content" android:layout_height="wrap_content" 
android:layout_marginLeft="10dip" android:layout_marginRight="15dip" 
android:layout_marginTop="2dip"></Button>
    </TableRow>

</TableLayout>


</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-26T16:14:44+00:00Added an answer on May 26, 2026 at 4:14 pm

    If you’re just looking to make your layout more manageable, there are a number of simple solutions I can think of. They mostly require zero to little design change.

    • You can add XML comments to separate logical sections, as ugly as they may be
    • You could divide your layout into separate included layouts
    • You can use fragments (using the Fragment Compatibility Package available through the SDK updater if necessary) to fragment your Activity into separate UI components which would have their own layout files. This is the only solution that would require moving your java code around, but I highly recommend it; it makes UI components highly reusable.
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm just getting started on writing functions instead of writing everything inline. Is this
I'm just getting started writing an app for WP (Mango), and am running into
I started writing this code a few days ago. I saw a question on
I've just started writing a reasonably straightforward site using sinatra. My problem is that
I've just started writing GAE web applications in Java so I'm kind of new
I just started writing powershell scripts for Citrix XenServer. However, I can only find
I have just installed C# 2008 Express Edition 2008 and started writing code. My
I am very new (started today) to writing chrome extensions but need to write
I just started writing RSpec tests, and I came across thoughtbot's Style Guide ,
I just started writing Plugins for jQuery. I found a good tutorial how to

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.