2016-08-17 2 views
0

Mein Scrollview auf meiner .xml funktioniert, aber es überlappt sich in der Symbolleiste Ich kann nicht mehr auf die Hierarchie zurück drücken und auch mein Android Studio auf 2.2 Beta idk aktualisiert, wenn dies der ist Problem.Scrollview auf Relative Layout-Überlappung in der Symbolleiste

Hier ist es.

<?xml version="1.0" encoding="utf-8"?> 
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android" 
android:layout_width="match_parent" 
android:layout_height="match_parent" > 

<RelativeLayout 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:layout_width="match_parent" 
android:layout_height="match_parent" 
android:orientation="vertical" 
app:layout_behavior="@string/appbar_scrolling_view_behavior" 
tools:context="com.example.kun.carkila.DetailActivity" 
tools:showIn="@layout/activity_detail"> 


<EditText 
    android:layout_width="wrap_content" 
    android:layout_height="wrap_content" 
    android:id="@+id/etResDate" 
    android:editable="false" 
    android:hint="Reservation Date" 
    android:layout_below="@+id/etPickup" 
    android:layout_alignParentLeft="true" 
    android:layout_alignParentStart="true" 
    android:layout_alignParentRight="true" 
    android:layout_alignParentEnd="true" /> 

<EditText 
    android:layout_width="wrap_content" 
    android:layout_height="wrap_content" 
    android:id="@+id/etResTime" 
    android:editable="false" 
    android:hint="Reservation Time" 
    android:layout_below="@+id/etResDate" 
    android:layout_alignParentLeft="true" 
    android:layout_alignParentStart="true" 
    android:layout_alignParentRight="true" 
    android:layout_alignParentEnd="true" /> 

<EditText 
    android:layout_width="wrap_content" 
    android:layout_height="wrap_content" 
    android:inputType="textPersonName" 
    android:ems="10" 
    android:id="@+id/etPickup" 
    android:hint="Pickup Location" 
    android:layout_below="@+id/tvPoster" 
    android:layout_alignParentLeft="true" 
    android:layout_alignParentStart="true" 
    android:layout_marginTop="22dp" 
    android:layout_alignParentRight="true" 
    android:layout_alignParentEnd="true" /> 

<EditText 
    android:layout_width="wrap_content" 
    android:layout_height="wrap_content" 
    android:id="@+id/etReturnTime" 
    android:editable="false" 
    android:hint="Return Time" 
    android:layout_below="@+id/etReturnDate" 
    android:layout_alignParentLeft="true" 
    android:layout_alignParentStart="true" 
    android:layout_alignParentRight="true" 
    android:layout_alignParentEnd="true" /> 

<Button 
    android:layout_width="wrap_content" 
    android:layout_height="wrap_content" 
    android:text="Rent" 
    android:id="@+id/btnRent" 
    android:layout_below="@+id/etReturnTime" 
    android:layout_centerHorizontal="true" /> 

<ImageView 
    android:layout_width="wrap_content" 
    android:layout_height="wrap_content" 
    android:id="@+id/ivImage" 
    android:src="@android:drawable/star_big_on" 
    android:layout_alignParentTop="true" 
    android:layout_centerHorizontal="true" /> 

<TextView 
    android:layout_width="wrap_content" 
    android:layout_height="wrap_content" 
    android:textAppearance="?android:attr/textAppearanceLarge" 
    android:text="Large Text" 
    android:id="@+id/tvCarModel" 
    android:layout_below="@+id/ivImage" 
    android:layout_centerHorizontal="true" /> 

<TextView 
    android:layout_width="wrap_content" 
    android:layout_height="wrap_content" 
    android:textAppearance="?android:attr/textAppearanceLarge" 
    android:text="Large Text" 
    android:id="@+id/tvCarType" 
    android:layout_below="@+id/tvCarModel" 
    android:layout_alignLeft="@+id/tvCarModel" 
    android:layout_alignStart="@+id/tvCarModel" /> 

<TextView 
    android:layout_width="wrap_content" 
    android:layout_height="wrap_content" 
    android:textAppearance="?android:attr/textAppearanceLarge" 
    android:text="Large Text" 
    android:id="@+id/tvCapacity" 
    android:layout_below="@+id/tvCarType" 
    android:layout_alignLeft="@+id/tvCarType" 
    android:layout_alignStart="@+id/tvCarType" /> 

<TextView 
    android:layout_width="wrap_content" 
    android:layout_height="wrap_content" 
    android:textAppearance="?android:attr/textAppearanceLarge" 
    android:text="Large Text" 
    android:id="@+id/tvFuelType" 
    android:layout_below="@+id/tvCapacity" 
    android:layout_centerHorizontal="true" /> 

<TextView 
    android:layout_width="wrap_content" 
    android:layout_height="wrap_content" 
    android:textAppearance="?android:attr/textAppearanceLarge" 
    android:text="Large Text" 
    android:id="@+id/tvPoster" 
    android:layout_below="@+id/tvPlateNumber" 
    android:layout_alignLeft="@+id/tvPlateNumber" 
    android:layout_alignStart="@+id/tvPlateNumber" /> 

<TextView 
    android:layout_width="wrap_content" 
    android:layout_height="wrap_content" 
    android:textAppearance="?android:attr/textAppearanceLarge" 
    android:text="Large Text" 
    android:id="@+id/tvPlateNumber" 
    android:layout_below="@+id/tvFuelType" 
    android:layout_alignLeft="@+id/tvFuelType" 
    android:layout_alignStart="@+id/tvFuelType" /> 

<EditText 
    android:layout_width="wrap_content" 
    android:layout_height="wrap_content" 
    android:id="@+id/etReturnDate" 
    android:editable="false" 
    android:hint="Return Date" 
    android:layout_below="@+id/etResTime" 
    android:layout_alignParentLeft="true" 
    android:layout_alignParentStart="true" 
    android:layout_alignParentRight="true" 
    android:layout_alignParentEnd="true" /> 

</RelativeLayout> 

screenshot of my overlapping scrollview

+0

Bitte geben Sie hilft. –

+0

@AmitVaghela - Ich habe den Code aktualisiert, den ich vergessen habe, meinen Scrollview hinzuzufügen. Srry. –

+0

@jaydroider - Theres ein Screenshot Sir ich habe es aktualisiert. :) –

Antwort

0

entfernen diese app:layout_behavior‌​="@string/appbar_scro‌​lling_view_behavior" von Relative Layout.

<ScrollView xmlns:android="http://schemas.android.com/apk/res/android" 
    android:layout_width="match_parent" 
    android:layout_height="match_parent" 
    app:layout_behavior="@string/appbar_scrolling_view_behavior"> 

    <RelativeLayout 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:layout_width="match_parent" 
    android:layout_height="match_parent" 
    android:orientation="vertical" 
    tools:context="com.example.kun.carkila.DetailActivity" 
    tools:showIn="@layout/activity_detail"> 
0

Bitte tun Sie etwas wie unten XML-Code oder fügen Sie einfach Ihre EditText/Textview-Komponente zwischen NestedScrollView

<?xml version="1.0" encoding="utf-8"?> 
<LinearLayout 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/addtimesheetlayout" 
android:layout_width="match_parent" 
android:layout_height="match_parent" 
tools:context="com.example.kun.carkila.DetailActivity" 
android:orientation="vertical"> 

<android.support.v4.widget.NestedScrollView 
android:id="@+id/scrollableview" 
android:layout_width="match_parent" 
android:layout_height="match_parent" 
android:scrollbars="vertical" 
app:layout_behavior="@string/appbar_scrolling_view_behavior"> 

<LinearLayout 
    android:layout_width="fill_parent" 
    android:layout_height="fill_parent" 
    android:orientation="vertical"> 
<!--Add your EditText here--> 


</LinearLayout><!--Main layout ends--> 

</android.support.v4.widget.NestedScrollView> 

</LinearLayout> 

Wenn dieser Code-Schnipsel ist nützliche Abstimmung als akzeptierte Antwort.

0
<?xml version="1.0" encoding="utf-8"?> 
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android" 
    android:layout_width="match_parent" 
    android:layout_height="match_parent"> 

    <RelativeLayout 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:layout_width="match_parent" 
     android:layout_height="match_parent" 
     android:orientation="vertical" 
     tools:context="com.example.kun.carkila.DetailActivity"> 


     <EditText 
      android:id="@+id/etResDate" 
      android:layout_width="wrap_content" 
      android:layout_height="wrap_content" 
      android:layout_alignParentEnd="true" 
      android:layout_alignParentLeft="true" 
      android:layout_alignParentRight="true" 
      android:layout_alignParentStart="true" 
      android:layout_below="@+id/etPickup" 
      android:editable="false" 
      android:hint="Reservation Date" /> 

     <EditText 
      android:id="@+id/etResTime" 
      android:layout_width="wrap_content" 
      android:layout_height="wrap_content" 
      android:layout_alignParentEnd="true" 
      android:layout_alignParentLeft="true" 
      android:layout_alignParentRight="true" 
      android:layout_alignParentStart="true" 
      android:layout_below="@+id/etResDate" 
      android:editable="false" 
      android:hint="Reservation Time" /> 

     <EditText 
      android:id="@+id/etPickup" 
      android:layout_width="wrap_content" 
      android:layout_height="wrap_content" 
      android:layout_alignParentEnd="true" 
      android:layout_alignParentLeft="true" 
      android:layout_alignParentRight="true" 
      android:layout_alignParentStart="true" 
      android:layout_below="@+id/tvPoster" 
      android:layout_marginTop="22dp" 
      android:ems="10" 
      android:hint="Pickup Location" 
      android:inputType="textPersonName" /> 

     <EditText 
      android:id="@+id/etReturnTime" 
      android:layout_width="wrap_content" 
      android:layout_height="wrap_content" 
      android:layout_alignParentEnd="true" 
      android:layout_alignParentLeft="true" 
      android:layout_alignParentRight="true" 
      android:layout_alignParentStart="true" 
      android:layout_below="@+id/etReturnDate" 
      android:editable="false" 
      android:hint="Return Time" /> 

     <Button 
      android:id="@+id/btnRent" 
      android:layout_width="wrap_content" 
      android:layout_height="wrap_content" 
      android:layout_below="@+id/etReturnTime" 
      android:layout_centerHorizontal="true" 
      android:text="Rent" /> 

     <ImageView 
      android:id="@+id/ivImage" 
      android:layout_width="wrap_content" 
      android:layout_height="wrap_content" 
      android:layout_alignParentTop="true" 
      android:layout_centerHorizontal="true" 
      android:src="@android:drawable/star_big_on" /> 

     <TextView 
      android:id="@+id/tvCarModel" 
      android:layout_width="wrap_content" 
      android:layout_height="wrap_content" 
      android:layout_below="@+id/ivImage" 
      android:layout_centerHorizontal="true" 
      android:text="Large Text" 
      android:textAppearance="?android:attr/textAppearanceLarge" /> 

     <TextView 
      android:id="@+id/tvCarType" 
      android:layout_width="wrap_content" 
      android:layout_height="wrap_content" 
      android:layout_alignLeft="@+id/tvCarModel" 
      android:layout_alignStart="@+id/tvCarModel" 
      android:layout_below="@+id/tvCarModel" 
      android:text="Large Text" 
      android:textAppearance="?android:attr/textAppearanceLarge" /> 

     <TextView 
      android:id="@+id/tvCapacity" 
      android:layout_width="wrap_content" 
      android:layout_height="wrap_content" 
      android:layout_alignLeft="@+id/tvCarType" 
      android:layout_alignStart="@+id/tvCarType" 
      android:layout_below="@+id/tvCarType" 
      android:text="Large Text" 
      android:textAppearance="?android:attr/textAppearanceLarge" /> 

     <TextView 
      android:id="@+id/tvFuelType" 
      android:layout_width="wrap_content" 
      android:layout_height="wrap_content" 
      android:layout_below="@+id/tvCapacity" 
      android:layout_centerHorizontal="true" 
      android:text="Large Text" 
      android:textAppearance="?android:attr/textAppearanceLarge" /> 

     <TextView 
      android:id="@+id/tvPoster" 
      android:layout_width="wrap_content" 
      android:layout_height="wrap_content" 
      android:layout_alignLeft="@+id/tvPlateNumber" 
      android:layout_alignStart="@+id/tvPlateNumber" 
      android:layout_below="@+id/tvPlateNumber" 
      android:text="Large Text" 
      android:textAppearance="?android:attr/textAppearanceLarge" /> 

     <TextView 
      android:id="@+id/tvPlateNumber" 
      android:layout_width="wrap_content" 
      android:layout_height="wrap_content" 
      android:layout_alignLeft="@+id/tvFuelType" 
      android:layout_alignStart="@+id/tvFuelType" 
      android:layout_below="@+id/tvFuelType" 
      android:text="Large Text" 
      android:textAppearance="?android:attr/textAppearanceLarge" /> 

     <EditText 
      android:id="@+id/etReturnDate" 
      android:layout_width="wrap_content" 
      android:layout_height="wrap_content" 
      android:layout_alignParentEnd="true" 
      android:layout_alignParentLeft="true" 
      android:layout_alignParentRight="true" 
      android:layout_alignParentStart="true" 
      android:layout_below="@+id/etResTime" 
      android:editable="false" 
      android:hint="Return Date" /> 

    </RelativeLayout> 
</ScrollView> 

überprüfen, ob dieser Schuss einen Bildschirm

Verwandte Themen