に焦点を当てていないが、この
<LinearLayout
android:id="@+id/ll2"
android:focusableInTouchMode="true"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<android.support.v7.widget.RecyclerView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="5dp"
android:clipToPadding="false"
android:visibility="visible"/>
</LinearLayout>
とJavaコード
ItemsArrayList.add(0, items5);
adapter.notifyDataSetChanged();
NestedScrollView nestedScrollingView = (NestedScrollView) findViewById(R.id.nestedScrollingView);
LinearLayout linearLayout = (LinearLayout) findViewById(R.id.ll2);
float y = fcRecyclerView.getChildAt(0).getY();
float z =linearLayout.getY();
nestedScrollingView.smoothScrollTo(0, (int) z);
のようなあなたのrecyclerviewを作るあなたは 'recyclerViewを試してみました.smoothScrollToPosition(position) '? – jlively
それは動作しません。私のrecyclerlerviewはnestedscrollviewの内部にあります。 –
あなたは何か答えを見つけましたか? – praj