a.t*_*aby 5 android android-recyclerview
我有一个水平 RecyclerView:
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/white"
android:orientation="vertical">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="25dp"
android:layout_alignParentBottom="true"
android:background="?attr/colorPrimary" />
<android.support.v7.widget.RecyclerView
android:id="@+id/actions_recycler_view"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:elevation="@dimen/padding_default" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_above="@id/actions_recycler_view"
android:layout_alignParentTop="true"
android:orientation="vertical">
<LinearLayout
android:id="@+id/content_frame_layout"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1"
android:orientation="vertical" />
<include layout="@layout/horizontal_line" />
</LinearLayout>
Run Code Online (Sandbox Code Playgroud)
我设置 LinearlayoutManager 如下:
RecyclerView actionsRecyclerView = (RecyclerView)
view.findViewById(R.id.actions_recycler_view);
actionsRecyclerView.setLayoutManager(
new LinearLayoutManager(getActivity(), LinearLayoutManager.HORIZONTAL, false));
actionsRecyclerView.setAdapter(actionsAdapter);
Run Code Online (Sandbox Code Playgroud)
它在许多设备上都能完美运行,但在 Samsung SM-T258 (android 5.1.1) 上,id 无法在横向模式下工作。它不起作用,我的意思是它不会通过向左和向右滑动来滚动。我必须旋转平板电脑并再次旋转才能RecyclerView开始工作!有人可以在这方面帮助我吗?
| 归档时间: |
|
| 查看次数: |
395 次 |
| 最近记录: |