2016-04-13 52 views
1

NestedScrollViewの内部でListViewを使用しています。 リストは親に一致するように拡大したが何のスクロールはここで今NestedScrollViewの内部でスクロールしないListView

ありませんが、私のレイアウトです:

<android.support.v4.widget.NestedScrollView 
    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="wrap_content" 
    app:layout_behavior="@string/appbar_scrolling_view_behavior" 
    android:fillViewport="true" 
> 
     <LinearLayout 
      android:orientation="vertical" 
      android:layout_width="match_parent" 
      android:layout_height="wrap_content"> 

      <ListView 
       android:layout_width="fill_parent" 
       android:layout_height="wrap_content" 
       android:layout_centerHorizontal="true" 
       android:id="@+id/workExperienceListLV" 
       android:divider="@null" 
       android:listSelector="@android:color/transparent" 
       android:dividerHeight="0dp"/> 

     </LinearLayout> 

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

このライン助けにはならなかった。助けを

android:fillViewport="true" 

感謝を!

+1

recyclerviewを使用すると、listviewでnestedscrolling機能を使用することはできません。 –

+0

@oguzhandそれは私がlistViewで動作させることができる方法はありますか? –

+0

ListViewでスクロールが利用可能なので、ScrollViewをラップすることはできません。代わりにlayout_heightをdpに設定すると200dpとなり、レイアウトはスクロールします。そのレイアウトでListViewのみを使用する場合は、NestedScrollViewをラップする必要はありません。 – ABI

答えて

-1

これは、スクロールビュー(NestedScrollView)内のListViewを使用しているためです。両方のスクロールを持つことができます。これをスクロールする場合は、リストビューの幅を画面の半分に縮小します。このような ...

<ListView 
       android:layout_width="70dp" 
       android:layout_height="wrap_content" 
       android:layout_centerHorizontal="true" 
       android:id="@+id/workExperienceListLV" 
       android:divider="@null" 
       android:listSelector="@android:color/transparent" 
       android:dividerHeight="0dp"/> 
0

使用ViewCompat.setNestedScrollingEnabled()、あなたは問題ないはずです。

関連する問題