Android XML abschneiden der unteren Hälfte des Layouts

Ich habe ein problem mit meinem XML-layout, etwas, das ich dachte, würde nicht geben Sie mir viele Probleme. Ich habe ein layout unten in der scroll-Ansicht, aber den unteren Rand des Layouts abgeschnitten ist, ich kann nichts sehen hinter der zweiten Liste anzeigen. Von der Suche rund um, ich kann nicht scheinen, um zu sehen, nichts falsch mit dem xml selbst, und ich kann nicht sehen, was ich falsch mache.

Ich habe versucht den Vorschlag zu dem problem, dass das hinzufügen von ein Gewicht auf jede der verschiedenen Elemente sind aber noch nicht das problem gelöst.

Habe ich auch Hinzugefügt, die die main-Aktivität, in der das fragment platziert incase, die helfen könnten, das problem zu lösen

XML-Fragment

<?xml version="1.0" encoding="utf-8"?>
<android.support.design.widget.CoordinatorLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:id="@+id/coordinatorLayout">
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="fill_parent"
    android:layout_height="wrap_content"
    android:fillViewport="true"
    android:scrollbars="vertical">
    <LinearLayout
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:orientation="vertical">
        <android.support.design.widget.TextInputLayout
            android:id="@+id/text_input_layout"
            android:layout_width="match_parent"
            android:layout_height="0dp"
            android:layout_weight="1">

            <EditText
                android:id="@+id/editText"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:hint="Recipe Title"/>
        </android.support.design.widget.TextInputLayout>

        <TextView
            android:id="@+id/ingredientsHeading"
            android:layout_below="@+id/text_input_layout"
            android:layout_width="fill_parent"
            android:layout_height="0dp"
            android:text="Ingredients"
            android:textStyle="bold|italic"
            android:layout_weight="1" />
        <ListView
            android:id="@+id/ingredientsList"
            android:layout_below="@+id/ingredientsHeading"
            android:layout_above="@+id/directionsHeading"
            android:layout_width="wrap_content"
            android:layout_height="195dp"
            android:layout_weight="1"></ListView>

        <Button style="@style/Button"
            android:layout_width="wrap_content"
            android:layout_height="0dp"
            android:text="Add Ingredient"
            android:id="@+id/addIngredient"
            android:layout_below="@+id/ingredientsList"
            android:enabled="true"
            android:layout_gravity="center_horizontal"
            android:layout_weight="1" />

        <TextView
            android:id="@+id/directionsHeading"
            android:layout_below="@+id/addIngredient"
            android:layout_width="fill_parent"
            android:layout_height="0dp"
            android:text="Directions"
            android:textStyle="bold|italic"
            android:layout_weight="1" />
        <ListView
            android:id="@+id/directionsList"
            android:layout_below="@+id/directionsHeading"
            android:layout_width="wrap_content"
            android:layout_height="195dp"
            android:layout_weight="1"></ListView>

        <Button style="@style/Button"
            android:layout_width="wrap_content"
            android:layout_height="0dp"
            android:text="Add Direction"
            android:id="@+id/addDirection"
            android:layout_below="@+id/ingredientsList"
            android:enabled="true"
            android:layout_gravity="center_horizontal"
            android:layout_weight="1" />

    </LinearLayout>

</ScrollView>


<android.support.design.widget.FloatingActionButton
    android:id="@+id/filterButton"
    app:backgroundTint="@color/floatingButton"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:layout_gravity="bottom|right"
    android:clickable="true"
    android:src="@drawable/ic_filter"
    android:layout_alignParentBottom="true"
    android:layout_alignParentEnd="true"
    android:layout_marginBottom="63dp"
    android:layout_marginRight="16dp" />


</android.support.design.widget.CoordinatorLayout>

Haupt-XML -

<android.support.v4.widget.DrawerLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/drawer_layout"
android:layout_width="match_parent"
android:layout_height="match_parent">
<!-- The main content view -->

<android.support.design.widget.CoordinatorLayout
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    xmlns:tools="http://schemas.android.com/tools"
    android:id="@+id/drawer_layout2">

    <android.support.design.widget.AppBarLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar">

        <android.support.v7.widget.Toolbar
            android:id="@+id/toolbar"
            android:layout_width="match_parent"
            android:layout_height="?attr/actionBarSize"
            android:background="?attr/colorPrimary"
            app:layout_scrollFlags="scroll|enterAlways"
            app:popupTheme="@style/ThemeOverlay.AppCompat.Light" />

        <android.support.design.widget.TabLayout
            android:id="@+id/tabs"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            app:tabMode="fixed"
            app:tabGravity="fill"/>
    </android.support.design.widget.AppBarLayout>

    <android.support.v4.view.ViewPager
        android:id="@+id/viewpager"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        app:layout_behavior="@string/appbar_scrolling_view_behavior" />

    <FrameLayout
        android:id="@+id/container_body"
        android:layout_width="fill_parent"
        android:layout_height="0dp"
        android:layout_weight="1" />

</android.support.design.widget.CoordinatorLayout>


<fragment
    android:id="@+id/fragment_navigation_drawer"
    android:name="com.example.rory.pocketchef.Fragments.FragmentDrawer"
    android:layout_width="@dimen/nav_drawer_width"
    android:layout_height="match_parent"
    android:layout_gravity="start"
    app:layout="@layout/fragment_navigation_drawer"
    tools:layout="@layout/fragment_navigation_drawer" />

</android.support.v4.widget.DrawerLayout>
  • poste bitte einen screenshot...
  • Sie sollten nicht verschachtelt GEWICHTE. Android studio muss haben davor gewarnt, über Sie und auch das Gewicht kann nie mehr als weightsum
InformationsquelleAutor JJSmith | 2016-02-20
Schreibe einen Kommentar