2016-10-09 4 views
1

Ich habe eine RelativeLayout innerhalb ScrollView mit verschiedenen Elementen in einem Fragment aufgeblasen.ScrollView RelativeLayout Element an der Unterseite ist nicht sichtbar

Was ich beobachtet habe, ist das Element an der Unterseite der ist nicht sichtbar. Die scroll ist aktiviert, während ich nach unten scrolle, aber das unterste Element ist nie sichtbar.

Ich habe unten als auch versucht, immer noch die gleichen

1) Unter Verwendung LinearLayout

2) ein anderes Element an der Unterseite Verwendung.

Das Layout Dateiinhalt ist wie folgt:

<ScrollView xmlns:android="http://schemas.android.com/apk/res/android" 
android:layout_width="match_parent" 
android:layout_height="wrap_content"> 

    <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" 
    xmlns:tools="http://schemas.android.com/tools" 
    android:id="@+id/LinearLayout1" 
    android:layout_width="match_parent" 
    android:layout_height="match_parent" 
    android:orientation="vertical" 
    android:padding="10dp" > 

    <GridView 
    android:id="@+id/gridView1" 
    android:layout_width="match_parent" 
    android:layout_height="wrap_content" 
    android:layout_alignParentLeft="true" 
    android:numColumns="5" 
    android:layout_marginBottom="8dp" 
    android:layout_marginStart="2dp" 
    android:layout_marginEnd="2dp" 
    android:layout_marginTop="4dp"/> 

    <View 
    android:id="@+id/center_divider1" 
    android:layout_width="match_parent" 
    android:layout_height="1dp" 
    android:layout_below="@+id/gridView1" 
    android:background="@android:color/darker_gray" /> 

    <Spinner 
    android:id="@+id/spinnerCountry" 
    android:layout_width="wrap_content" 
    android:layout_height="wrap_content" 
    android:layout_centerHorizontal="true" 
    android:layout_marginBottom="8dp" 
    android:layout_marginStart="2dp" 
    android:layout_marginEnd="2dp" 
    android:layout_marginTop="8dp" 
    android:minWidth="250dp" 
    android:layout_below="@+id/center_divider1" 
    android:entries="@array/category" /> 

    <Spinner 
    android:id="@+id/spinnerCity" 
    android:layout_width="wrap_content" 
    android:layout_height="wrap_content" 
    android:layout_alignLeft="@+id/spinnerCountry" 
    android:layout_below="@+id/spinnerCountry" 
    android:layout_marginBottom="8dp" 
    android:layout_marginStart="2dp" 
    android:layout_marginEnd="2dp" 
    android:layout_marginTop="4dp" 
    android:minWidth="250dp" 
    android:entries="@array/cars_vehicles" /> 

    <View 
    android:id="@+id/center_divider2" 
    android:layout_width="match_parent" 
    android:layout_height="1dp" 
    android:layout_below="@+id/spinnerCity" 
    android:background="@android:color/darker_gray" /> 

    <RadioGroup 
    android:id="@+id/condition" 
    android:layout_width="wrap_content" 
    android:layout_height="wrap_content" 
    android:gravity="center" 
    android:orientation="horizontal" 
    android:layout_marginBottom="8dp" 
    android:layout_marginStart="2dp" 
    android:layout_marginEnd="2dp" 
    android:layout_marginTop="8dp" 
    android:layout_below="@+id/center_divider2"> 

    <RadioButton 
     android:id="@+id/radioUsed" 
     android:layout_width="wrap_content" 
     android:layout_height="wrap_content" 
     android:text="Used" 
     android:checked="true" /> 

    <RadioButton 
     android:id="@+id/radioNew" 
     android:layout_width="wrap_content" 
     android:layout_height="wrap_content" 
     android:text="New" /> 

    </RadioGroup> 

    <View 
    android:id="@+id/center_divider3" 
    android:layout_width="match_parent" 
    android:layout_height="1dp" 
    android:layout_below="@+id/condition" 
    android:background="@android:color/darker_gray" /> 

    <android.support.design.widget.TextInputLayout 
    android:id="@+id/item_list_price" 
    android:layout_width="match_parent" 
    android:layout_height="wrap_content" 
    android:layout_marginBottom="4dp" 
    android:layout_marginStart="2dp" 
    android:layout_marginEnd="2dp" 
    android:layout_marginTop="8dp" 
    android:layout_below="@+id/center_divider3"> 

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

    <android.support.design.widget.TextInputLayout 
    android:id="@+id/item_list_year" 
    android:layout_width="match_parent" 
    android:layout_height="wrap_content" 
    android:layout_marginBottom="4dp" 
    android:layout_marginStart="2dp" 
    android:layout_marginEnd="2dp" 
    android:layout_marginTop="4dp" 
    android:layout_below="@+id/item_list_price"> 
    <EditText 
     android:id="@+id/year" 
     android:layout_width="match_parent" 
     android:layout_height="wrap_content" 
     android:hint="year of purchase" /> 
    </android.support.design.widget.TextInputLayout> 

    <android.support.design.widget.TextInputLayout 
    android:id="@+id/item_list_kms" 
    android:layout_width="match_parent" 
    android:layout_height="wrap_content" 
    android:layout_marginBottom="4dp" 
    android:layout_marginStart="2dp" 
    android:layout_marginEnd="2dp" 
    android:layout_marginTop="4dp" 
    android:layout_below="@+id/item_list_year" > 
    <EditText 
     android:id="@+id/kms" 
     android:layout_width="match_parent" 
     android:layout_height="wrap_content" 
     android:hint="kms" /> 
    </android.support.design.widget.TextInputLayout> 

    <android.support.design.widget.TextInputLayout 
    android:id="@+id/item_list_mileage" 
    android:layout_width="match_parent" 
    android:layout_height="wrap_content" 
    android:layout_marginBottom="8dp" 
    android:layout_marginStart="2dp" 
    android:layout_marginEnd="2dp" 
    android:layout_marginTop="4dp" 
    android:layout_below="@+id/item_list_kms" > 
    <EditText 
     android:id="@+id/mileage" 
     android:layout_width="match_parent" 
     android:layout_height="wrap_content" 
     android:hint="mileage" /> 
    </android.support.design.widget.TextInputLayout> 

    <RadioGroup 
     android:id="@+id/airCondition" 
     android:layout_width="wrap_content" 
     android:layout_height="wrap_content" 
     android:gravity="center" 
     android:orientation="horizontal" 
     android:layout_marginBottom="8dp" 
     android:layout_marginStart="2dp" 
     android:layout_marginEnd="2dp" 
     android:layout_marginTop="8dp" 
     android:layout_below="@+id/item_list_mileage" > 

     <RadioButton 
      android:id="@+id/Yes" 
      android:layout_width="wrap_content" 
      android:layout_height="wrap_content" 
      android:text="Yes" 
      android:checked="true" /> 

     <RadioButton 
      android:id="@+id/No" 
      android:layout_width="wrap_content" 
      android:layout_height="wrap_content" 
      android:text="No" /> 
    </RadioGroup> 

    <android.support.design.widget.TextInputLayout 
    android:id="@+id/item_list_description" 
    android:layout_width="match_parent" 
    android:layout_height="wrap_content" 
    android:layout_marginBottom="8dp" 
    android:layout_marginStart="2dp" 
    android:layout_marginEnd="2dp" 
    android:layout_marginTop="4dp" 
    android:layout_below="@+id/airCondition" > 
    <EditText 
     android:id="@+id/description" 
     android:layout_width="match_parent" 
     android:layout_height="wrap_content" 
     android:hint="description" 
     android:inputType="textMultiLine" 
     android:lines="3" 
     android:minLines="3" 
     android:gravity="top|left" 
     android:maxLines="5" /> 
    </android.support.design.widget.TextInputLayout> 

    <Button 
    android:id="@+id/btnSelectPhoto" 
    android:layout_width="wrap_content" 
    android:layout_height="wrap_content" 
    android:layout_marginLeft="20dp" 
    android:layout_marginTop="20dp" 
    android:layout_below="@+id/item_list_description" 
    android:text="Submit.." /> 

    </RelativeLayout> 
</ScrollView> 
+0

, wie wäre es, wenn die scollview zu height = match_parent gesetzt –

Antwort

1

ich Ihr Layout in einen Test-App kopiert und es sieht gut für mich. Ich nehme an, dass die Ansicht, die Sie nicht sehen können, die Schaltfläche Submit ... ist, richtig?

enter image description here

Sind Sie mit dieser auf einem tatsächlichen Telefon oder auf einem Emulator?

Vielleicht versuchen, einen unteren Rand zu dieser Schaltfläche hinzufügen (nur zum Testen), um zu sehen, ob es irgendwie sichtbar macht.

+0

Dank es funktioniert nach den unteren Rand hinzugefügt wird. Es ist seltsam, aber nicht sicher, was könnte der Grund sein? Irgendeine Idee? – dacscan3669

0

Ich habe Ihren Code mit einer Beispielanwendung ausprobiert und konnte das untere Element sehen. Angehängte Screenshots von Anfang und Ende des Scrolls. Ich glaube, das untere Element ist der Knopf. Hast du immer noch das Problem?

enter image description here

enter image description here

+0

Ich versuche, dies auf dem tatsächlichen Telefon einzustellen. Was könnte der Grund sein? Das Element am unteren Rand ist der Submit-Button. – dacscan3669

Verwandte Themen