Note that there are some explanatory texts on larger screens.

plurals
  1. POAndroid Layout overlays when app is executed
    primarykey
    data
    text
    <p>I have made a program that contains headings on the left side and the values on the right side: (Note, they are all of the TextView type.</p> <p>But as soon as i run the application the fields seem to overlay over the top of one another. This is probably due to them re sizing when new values are dynamically added. How do i fix this? All im trying to do is make a simple layout :/</p> <p>Thank you for your time. And is there an easier way to do the layouts? I've tried sing the table layouts to structure the information a bit more, but the tables keeps moving and i cant add rows or anything :/ </p> <pre><code>&lt;RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" android:paddingBottom="@dimen/activity_vertical_margin" android:paddingLeft="@dimen/activity_horizontal_margin" android:paddingRight="@dimen/activity_horizontal_margin" android:paddingTop="@dimen/activity_vertical_margin" tools:context=".MainActivity" &gt; &lt;TextView android:id="@+id/shipName" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignParentLeft="true" android:layout_alignParentTop="true" android:text="Ship Name" android:textAppearance="?android:attr/textAppearanceMedium" /&gt; &lt;TextView android:id="@+id/upgrade2Name" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignLeft="@+id/shipName" android:layout_below="@+id/shipName" android:layout_marginTop="16dp" android:text="Speed:" /&gt; &lt;TextView android:id="@+id/shipDistance" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignLeft="@+id/shipName" android:layout_below="@+id/upgrade2Name" android:text="Distance:" android:textAppearance="?android:attr/textAppearanceSmall" /&gt; &lt;TextView android:id="@+id/shipLocation" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignLeft="@+id/shipName" android:layout_below="@+id/shipDistance" android:text="Location:" android:textAppearance="?android:attr/textAppearanceSmall" /&gt; &lt;TextView android:id="@+id/shipStatus" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignLeft="@+id/shipFuel" android:layout_below="@+id/shipFuel" android:text="Status:" /&gt; &lt;TextView android:id="@+id/locationActual" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_below="@+id/shipDistance" android:layout_toRightOf="@+id/shipName" android:text="Earth - Launch Station" /&gt; &lt;TextView android:id="@+id/distanceActua" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignBottom="@+id/shipDistance" android:layout_toRightOf="@+id/shipName" android:text="0" /&gt; &lt;TextView android:id="@+id/speedActual" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_above="@+id/distanceActua" android:layout_toRightOf="@+id/shipName" android:text="TextView" /&gt; &lt;Button android:id="@+id/launchButton" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignBaseline="@+id/upgradeButton" android:layout_alignBottom="@+id/upgradeButton" android:layout_centerHorizontal="true" android:text="Launch" /&gt; &lt;Button android:id="@+id/buyFuelButton" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignBaseline="@+id/launchButton" android:layout_alignBottom="@+id/launchButton" android:layout_alignParentRight="true" android:text="Buy Fuel" /&gt; &lt;Button android:id="@+id/upgradeButton" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignParentBottom="true" android:layout_alignParentLeft="true" android:layout_marginBottom="14dp" android:text="Upgrade" /&gt; &lt;TextView android:id="@+id/newsFeed" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignLeft="@+id/shipStatus" android:layout_below="@+id/shipStatus" android:layout_marginTop="62dp" android:text="TextView" /&gt; &lt;TextView android:id="@+id/Information" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignLeft="@+id/shipStatus" android:layout_below="@+id/shipStatus" android:text="Information:" /&gt; &lt;TextView android:id="@+id/statusActual" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_above="@+id/Information" android:layout_toRightOf="@+id/shipName" android:text="Ready for Launch" /&gt; &lt;TextView android:id="@+id/vehicleInfo" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignBaseline="@+id/Information" android:layout_alignBottom="@+id/Information" android:layout_toRightOf="@+id/shipName" android:text="0" /&gt; &lt;TextView android:id="@+id/textView1" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignLeft="@+id/Information" android:layout_below="@+id/Information" android:text="Money:" /&gt; &lt;TextView android:id="@+id/vehicleMoney" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_below="@+id/vehicleInfo" android:layout_toRightOf="@+id/shipName" android:text="0" /&gt; &lt;ProgressBar android:id="@+id/fuelBar" style="?android:attr/progressBarStyleHorizontal" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_above="@+id/statusActual" android:layout_alignParentRight="true" android:layout_toRightOf="@+id/shipName" /&gt; &lt;TextView android:id="@+id/shipFuel" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignLeft="@+id/shipLocation" android:layout_below="@+id/shipLocation" android:text="Fuel:" /&gt; &lt;LinearLayout android:layout_width="wrap_content" android:layout_height="wrap_content" android:orientation="vertical" &gt; &lt;/LinearLayout&gt; &lt;TableLayout android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignLeft="@+id/newsFeed" android:layout_centerVertical="true" &gt; &lt;TableRow android:id="@+id/tableRow1" android:layout_width="wrap_content" android:layout_height="wrap_content" &gt; &lt;/TableRow&gt; &lt;TableRow android:id="@+id/tableRow2" android:layout_width="wrap_content" android:layout_height="wrap_content" &gt; &lt;/TableRow&gt; &lt;TableRow android:id="@+id/tableRow3" android:layout_width="wrap_content" android:layout_height="wrap_content" &gt; &lt;/TableRow&gt; &lt;TableRow android:id="@+id/tableRow4" android:layout_width="wrap_content" android:layout_height="wrap_content" &gt; &lt;/TableRow&gt; &lt;TableRow android:id="@+id/tableRow5" android:layout_width="wrap_content" android:layout_height="wrap_content" &gt; &lt;/TableRow&gt; &lt;/TableLayout&gt; </code></pre> <p></p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload