我需要水平实现布局,但现在是线性布局,我不是我的错在哪里,但是我需要您的帮助来解决此问题
<android.support.design.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".MainActivity">
<android.support.v7.widget.RecyclerView
android:id="@+id/card_view_recycler_list"
android:scrollbars="horizontal"
android:layout_width="match_parent"
android:layout_height="match_parent" />
</android.support.design.widget.CoordinatorLayout>
答案 0 :(得分:0)
在您的Java类中输入以下代码:
LinearLayoutManager lManager = new
LinearLayoutManager(getApplicationContext(),LinearLayoutManager.HORIZONTAL, false);
lManager.setOrientation(LinearLayoutManager.HORIZONTAL);
mRecyclerView.setLayoutManager(lManager);