0
即時垂直結合試圖使用2點回收的觀點在1個線性佈局.. 作爲回收視圖將產生其自己的滾動,但其他數據保留在屏幕上完整..所以如何合併所有進入1個滾動enter code here
如何將多個回收視圖帶有滾動在1個線性佈局
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:background="@color/grey"
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:weightSum="100">
<LinearLayout
android:id="@+id/sliderhome"
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="70">
<com.daimajia.slider.library.SliderLayout
android:id="@+id/slider"
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:layout_scrollFlags="scroll|enterAlways"
/>
<com.daimajia.slider.library.Indicators.PagerIndicator
android:id="@+id/custom_indicator"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center"
/>
</LinearLayout>
<LinearLayout
android:layout_weight="30"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context="vlabs.chorbazaar.HomeFragment"
android:background="@color/white"
android:orientation="horizontal">
<android.support.v7.widget.RecyclerView
android:id="@+id/recycler_view"
android:layout_width="match_parent"
android:layout_height="match_parent"/>
</FrameLayout>
</LinearLayout>
</LinearLayout>
我嘗試讓我的滑塊和回收以滾動爲一體的...但滑塊是停留在一個固定的地方,同時回收視圖scorlls像往常一樣
即時通訊使用片段..因此,假設上面的代碼是我的家庭碎片..我改變了我的家庭碎片xml,如你所說..爲Mypageadapter ..做了一個類.. now ViewPager pager =(ViewPager)findViewById (R.id.viewPager); pager.setAdapter(new MyPagerAdapter(getSupportFragmentManager(),arrayList)); 這段代碼會去嗎?在我的主要活動中,我根據nav –
中的選擇調用了所有片段,什麼是陣列列表? –
arrayList中的數據發送分片ArrayList> arrayList = new ArrayList >(); ArrayList arrayFirst = new ArrayList <>(); arrayFirst.add(「one」); arrayFirst.add(「two」); ArrayList arraySound = new ArrayList <>(); arraySound.add(「three」); arraySound.add(「four」); arrayList.add(arrayFirst); arrayList.add(arraySound); –