Как прокрутить первый LinearLayout?
CardView базируется на RecyclerView.Как прокрутить LinearLayout с помощью RecyclerView в фрагменте
RecyclerView может прокручивать по умолчанию, но первый LinearLayout не может прокручиваться.
Я хочу, чтобы они оба прокручивались вместе.
Я попытался установить Scrollview из главного LinearLayout, но не работает ..
// считываем (1.pic)
Прочитайте фотографии к следующему:
- XML Layout
-
<LinearLayout android:layout_width="match_parent" android:layout_height="0dp" android:layout_weight="1.3" android:layout_marginTop="10dp" android:background="@color/white" android:orientation="vertical"> <LinearLayout android:layout_width="match_parent" android:layout_height="match_parent" android:layout_weight="1" android:orientation="horizontal"> <TextView android:layout_width="wrap_content" android:layout_height="wrap_content" android:paddingLeft="10dp" android:text="Hello" android:textSize="20dp"/> <TextView android:layout_width="wrap_content" android:layout_height="wrap_content" android:id="@+id/HelloUserText" android:text="Name" android:textSize="20dp" android:padding="10dp"/> </LinearLayout> <Button android:layout_width="match_parent" android:layout_height="wrap_content" android:text="Switch" android:id="@+id/SwtichBtn" android:layout_marginLeft="10dp" android:layout_marginRight="10dp" android:layout_marginBottom="5dp" android:background="@android:color/holo_blue_dark" android:textColor="@color/white" /> </LinearLayout> <LinearLayout android:layout_width="match_parent" android:layout_height="0dp" android:layout_weight="5"> <com.baoyz.widget.PullRefreshLayout android:id="@+id/swipeRefreshLayout" android:layout_width="match_parent" android:layout_height="match_parent"> <android.support.v7.widget.RecyclerView android:layout_width="match_parent" android:layout_height="match_parent" android:id="@+id/recipes_list"> </android.support.v7.widget.RecyclerView> </com.baoyz.widget.PullRefreshLayout> </LinearLayout> </LinearLayout>
Добро пожаловать в Stack Overflow! Чтобы помочь нам дать вам отличный ответ, это поможет нам, если вы взглянете на [Как спросить] (http://stackoverflow.com/help/how-to-ask), если вы еще этого не сделали. Было бы также полезно, если бы вы могли предоставить [Минимальный, полный и проверенный пример] (http://stackoverflow.com/help/mcve). Можете ли вы предоставить часть кода, который вы используете? –