私はAndroidプログラムを作成しています。このプログラムでは、ScrollView内部にRecyclerViewがあります。私はこのRecyclerViewにRecyclerViewAdapterを介してデータを追加しています。Recyclerビュー内のNestedScrollviewはスクロールしません
RecyclerViewの各項目には、垂直方向のLinearLayoutが1つあるNestedScrollviewがあります。私はこのLinearLayoutでImageViewを動的に追加しています。
問題は、画像がスクロールしていないことです。非常にまれなシナリオでは(画面上で何回もタップすることによって)、一度スクロールしました。
誰でも私にこれを助けることができますか?ここで
はコードがある -
親リサイクラービュー: -
<ScrollView
android:id="@+id/scroll_view"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
>
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="vertical"
>
<android.support.v7.widget.RecyclerView
android:id="@+id/id_recyclerview"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:divider="@color/gray3"
android:dividerHeight="5sp"
android:paddingLeft="2sp"
android:paddingTop="5sp"
android:paddingRight="2sp"/>
<com.app.sh.widget.WrappedGridView
android:id="@+id/gridView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@color/White"
android:numColumns="2">
</com.app.socialhand.widget.WrappedGridView>
</LinearLayout>
</ScrollView>
そしてリサイクラービューのアイテム: -
<android.support.v4.widget.NestedScrollView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="@+id/vScrollView"
android:layout_below="@id/iv_up"
android:layout_above="@+id/iv_down"
android:isScrollContainer="true"
>
<RelativeLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content">
<LinearLayout
android:id="@+id/ll_123"
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent"
>
</LinearLayout>
</RelativeLayout>
</android.support.v4.widget.NestedScrollView>
私は動的にll_123でImageViewsを追加しています。
ネストされたScrollViewも試しましたが、まだ動作していません。スクロールビューがなければ、リサイクラビューはスクロールしません。 –
あなたのコードを表示できますか? – giffell
こんにちはgiffell、私はコードを追加しました。 –