Xamarin Layout

  • Xamarin.Android

    Xamarin Layout

    Guten Abend,

    ich arbeite mich derzeit etwas in Xamarin ein. Dabei habe ich leider beim designen der GUI einige Probleme. Ich habe ein Layout das sich automatisch an die Größe des Displays anpassen soll. In diesem Layout befindet sich eine ListView und darunter befindet sich ein Button wenn ich nun die ListView auf match_parent stelle überdeckt die ListView meinen Button.

    Das Layout sieht so aus:
    Spoiler anzeigen

    XML-Quellcode

    1. <?xml version="1.0" encoding="utf-8"?>
    2. <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    3. android:orientation="vertical"
    4. android:layout_width="match_parent"
    5. android:layout_height="match_parent"
    6. android:minWidth="25px"
    7. android:minHeight="25px"
    8. android:gravity="top">
    9. <TextView
    10. android:text="New_Order"
    11. android:layout_width="match_parent"
    12. android:layout_height="wrap_content"
    13. android:id="@+id/newOrder_headerText"
    14. android:textSize="30dp" />
    15. <ListView
    16. android:minWidth="25px"
    17. android:minHeight="25px"
    18. android:layout_width="match_parent"
    19. android:id="@+id/newOrder_listView"
    20. android:background="@android:drawable/alert_light_frame"
    21. android:choiceMode="singleChoice"
    22. android:divider="@android:color/black"
    23. android:dividerHeight="2dp"
    24. android:layout_height="389.0dp" />
    25. <LinearLayout
    26. android:orientation="horizontal"
    27. android:minWidth="25px"
    28. android:minHeight="25px"
    29. android:layout_width="match_parent"
    30. android:id="@+id/newOrder_linearLayout_bottom"
    31. android:layout_height="wrap_content"
    32. android:gravity="bottom"
    33. android:layout_marginBottom="50.0dp"
    34. android:layout_gravity="bottom">
    35. <Button
    36. android:text="Bestätigen"
    37. android:layout_width="wrap_content"
    38. android:layout_height="wrap_content"
    39. android:id="@+id/newOrder_button_newOrderAccept" />
    40. <TextView
    41. android:text="0 € "
    42. android:layout_width="match_parent"
    43. android:layout_height="wrap_content"
    44. android:id="@+id/newOrder_textView_newOrderPrice"
    45. android:textSize="20dp"
    46. android:gravity="right"
    47. android:layout_gravity="right"
    48. android:textColor="@android:color/background_light" />
    49. </LinearLayout>
    50. </LinearLayout>



    Hat jemand einen Tipp wie ich das Problem am besten angehen soll?



    *EDIT*
    Ich hab das Problem nun lösen können. An stelle eines Linearen Layouts habe ich nun ein Relatives verwendet.

    Dieser Beitrag wurde bereits 1 mal editiert, zuletzt von „Fakiz“ ()