• After 15+ years, we've made a big change: Android Forums is now Early Bird Club. Learn more here.

Apps Linear Layout

hanidraidi

Lurker
I am trying to make an interface as in the image below using linear layout, I used the following code, but it did not work. What might be the issue here?
2m7j98z.jpg


Any Help is appreciated,

Hani

Code:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    android:orientation="vertical"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    tools:context=".CollectorActivity"
    >
  
   
    <Button
        android:id="@+id/button1"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:text="Capture" />

<LinearLayout
    android:orientation="vertical"
    android:layout_width="fill_parent"
    android:layout_height="wrap_content"
    tools:context=".CollectorActivity"
    >
   
   
    <LinearLayout
    android:orientation="horizontal"
    android:layout_width="fill_parent"
    android:layout_height="wrap_content"
    tools:context=".CollectorActivity"
    >
   
        <EditText
        android:id="@+id/editText1"
        android:editable="false"
        android:layout_width="wrap_content"
        android:layout_height="match_parent"
        android:ems="5"
        android:hint="X"
         >

        <requestFocus />
    </EditText>
   
        <EditText
        android:id="@+id/editText2"
        android:editable="false"
        android:layout_width="wrap_content"
        android:layout_height="match_parent"
        android:ems="5"
        android:hint="Y"
        >

        <requestFocus />
    </EditText>
   
   
        <EditText
        android:id="@+id/editText3"
        android:editable="false"
        android:layout_width="wrap_content"
        android:layout_height="match_parent"
        android:ems="5"
        android:hint="Z"
        >

        <requestFocus />
    </EditText>   
   
       
       
       
   
   
    </LinearLayout>

    <LinearLayout
    android:orientation="horizontal"
    android:layout_width="fill_parent"
    android:layout_height="wrap_content"
    tools:context=".CollectorActivity"
    >
   
        <EditText
        android:id="@+id/editText4"
        android:editable="false"
        android:layout_width="wrap_content"
        android:layout_height="match_parent"
        android:ems="8"
        android:hint="Speed"
        >

        <requestFocus />
    </EditText> 
   
        <EditText
        android:id="@+id/editText5"
        android:editable="false"
        android:layout_width="wrap_content"
        android:layout_height="match_parent"
        android:ems="8"
        android:hint="Accuracy"
        >

        <requestFocus />
    </EditText> 
   
    </LinearLayout>
   
</LinearLayout>
   
<com.esri.android.map.MapView
android:id="@+id/map"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
initExtent = "-1.3296373526814876E7 3930962.41823043 -1.2807176545789773E7 4201243.7502468005">
</com.esri.android.map.MapView>




</LinearLayout>
 
Many thanks jbak for your interest,

I meant by "it did not work" that it is not giving the interface which I am seeking for; the result of the code above is as in this screenshot

xexxk.jpg


However, I want the textviews to be aligned horizontally so they fill the width of the screen as in the screenshot in the above post (original question)
 
So, try to remove ems attribute. And - set for all EditText android:layout_width="0dp" , and set android:weight="1" .
 
Back
Top Bottom