2016-07-20 21 views
1

Ich verwende mehrzeiligen EditText in der Recycler View als Listenelement. Mein Problem ist, dass der EditText in der Recycler-Ansicht nicht reibungslos läuft.Verwenden Sie mehrzeiligen Bearbeitungstext mit Recycler View

Unten finden Sie die xml, die ich

<android.support.v4.widget.NestedScrollView 
       android:layout_width="fill_parent" 
       android:layout_height="fill_parent" 
       android:layout_weight="2" 
       android:background="@drawable/commentbox_bgright"> 

       <EditText 
        android:id="@+id/et_control" 
        android:layout_width="fill_parent" 
        android:layout_height="wrap_content" 
        android:background="@null" 
        android:gravity="top" 
        android:minLines="4" 
        android:padding="5dp" 
        android:scrollbars="vertical" 
        android:textCursorDrawable="@null" 
        android:textSize="12dp" /> 
      </android.support.v4.widget.NestedScrollView> 

Bitte helfen Sie mir auf diese

Für Recycler Ansicht

<android.support.v7.widget.RecyclerView 
        android:layout_width="match_parent" 
        android:layout_height="match_parent" 
        android:id="@+id/rec_actions" 
        android:layout_above="@+id/sepp" 
        android:nestedScrollingEnabled="true" /> 

Für Liste Artikel verwendet haben. Ich habe viel Zeit damit verbracht ...

Antwort

0

Ich habe versucht, Ihren code.And machte kleine Änderungen. Ich habe nestedcrollview entfernt und edittext in das relative Layout eingefügt. Scroll-Arbeit beleuchtete etwas reibungsloser und bemerkte keine anderen Scroll-Verhaltensänderungen, also schlage vor, dein Listenelement xml so zu ändern.

<RelativeLayout 
    xmlns:android="http://schemas.android.com/apk/res/android" 
    android:layout_width="wrap_content" 
    android:layout_height="wrap_content" 
    android:padding="10dp"> 

    <EditText 
       android:id="@+id/et_control" 
       android:layout_width="fill_parent" 
       android:layout_height="wrap_content" 
       android:background="@null" 
       android:gravity="top" 
       android:minLines="4" 
       android:padding="5dp" 
       android:scrollbars="vertical" 
       android:textCursorDrawable="@null" 
       android:textSize="12dp" /> 
</RelativeLayout> 
+0

Danke für Ihre Antwort, aber ich habe es bereits versucht und es funktioniert nicht. –