1. Are you ready for the Galaxy S20? Here is everything we know so far!

Troubles with layout

Discussion in 'Android Lounge' started by workbench, May 23, 2020.

  1. workbench

    workbench Lurker
    Thread Starter

    Hi everyone, i've the following layout.xml file:

    Code (Text):
    1.  
    2. <?xml version="1.0" encoding="utf-8"?>
    3. <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    4.     android:layout_width="match_parent"
    5.     android:layout_height="match_parent"
    6.     android:orientation="vertical">
    7.  
    8. <!--    <ScrollView
    9.         android:layout_width="match_parent"
    10.         android:layout_height="match_parent">
    11. -->
    12.     <LinearLayout
    13.         android:orientation="horizontal"
    14.         android:layout_width="match_parent"
    15.         android:layout_height="wrap_content"
    16.         android:padding="5dp">
    17.  
    18.         <Button
    19.             android:id="@+id/date_from_button"
    20.             android:layout_width="wrap_content"
    21.             android:layout_height="wrap_content"
    22.             android:layout_weight="1"
    23.             android:onClick="onButtonDateFrom"
    24.             android:layout_margin="5dp"
    25.             android:background="@drawable/buttonshape"
    26.             android:text="@string/datum_from_button" />
    27.  
    28.         <Button
    29.             android:id="@+id/date_to_button"
    30.             android:layout_width="wrap_content"
    31.             android:layout_height="wrap_content"
    32.             android:layout_weight="1"
    33.             android:layout_margin="5dp"
    34.             android:background="@drawable/buttonshape"
    35.             android:onClick="onButtonDateTo"
    36.             android:text="@string/datum_to_button" />
    37.  
    38.  
    39.     </LinearLayout>
    40.  
    41.     <DatePicker
    42.         android:layout_gravity="center"
    43.         android:layout_width="wrap_content"
    44.         android:layout_height="wrap_content"
    45.         android:visibility="gone"/>
    46.  
    47.     <LinearLayout
    48.         android:orientation="horizontal"
    49.         android:layout_width="match_parent"
    50.         android:layout_height="wrap_content"
    51.         android:padding="5dp">
    52.  
    53.         <Button
    54.             android:id="@+id/time_from_button"
    55.             android:layout_width="wrap_content"
    56.             android:layout_height="wrap_content"
    57.             android:layout_weight="1"
    58.             android:layout_margin="5dp"
    59.             android:background="@drawable/buttonshape"
    60.             android:onClick="onButtonTimeFrom"
    61.             android:text="@string/time_from_button" />
    62.  
    63.         <Button
    64.             android:id="@+id/time_to_button"
    65.             android:layout_width="wrap_content"
    66.             android:layout_height="wrap_content"
    67.             android:layout_weight="1"
    68.             android:layout_margin="5dp"
    69.             android:background="@drawable/buttonshape"
    70.             android:onClick="onButtonTimeTo"
    71.             android:text="@string/time_to_button" />
    72.  
    73.  
    74.     </LinearLayout>
    75.  
    76.     <DatePicker
    77.         android:layout_gravity="center"
    78.         android:layout_width="wrap_content"
    79.         android:layout_height="wrap_content"
    80.         android:visibility="gone"/>
    81.  
    82.     <FrameLayout
    83.         android:layout_width="match_parent"
    84.         android:layout_height="match_parent"
    85.         android:padding="10dp">
    86.  
    87.         <Button
    88.             android:layout_width="match_parent"
    89.             android:layout_height="wrap_content"
    90.             android:background="@drawable/buttonshape"
    91.             android:text="@string/search_start"/>
    92.  
    93.  
    94.     </FrameLayout>
    95.  
    96.     <LinearLayout
    97.         android:layout_width="match_parent"
    98.         android:layout_height="wrap_content">
    99.  
    100.         <EditText
    101.             android:id="@+id/editText"
    102.             android:layout_width="match_parent"
    103.             android:layout_height="wrap_content"
    104.             android:ems="10"
    105.             android:text="Name" />
    106.  
    107.     </LinearLayout>
    108.  
    109.  
    110.     <!--</ScrollView>-->
    111. </LinearLayout>
    112.  
    But i've the problem that the EditText is not shown. What am i doing wrong here ??
     


  2. workbench

    workbench Lurker
    Thread Starter

    solved the problem... but thanks anyways!
     
    MrJavi likes this.
  3. MrJavi

    MrJavi Android Expert

    ocnbrze likes this.
  4. :)
     
    #4 Madasa, May 23, 2020
    Last edited: May 23, 2020
Loading...

Share This Page

Loading...