SquareLayoutとRecyclerViewの2つのコンポーネントがあるLinearLayoutが1つあります。スクリーンの中央にSquareLayoutを、画面の下部にRecyclerViewを配置したいのですが、なぜ重力かわかりませんそれを設定するために働かない。私はアンドロイドで新しいです。私の質問がはっきりしていることを願っています。ここに私の.xmlファイルです。LinearLayoutを中央に設定する
<LinearLayout 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"
android:orientation="vertical" >
<com.example.layouts.SquareLayout
android:id="@+id/llSelectedLayout"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_gravity="center"
></com.example.layouts.SquareLayout>
<android.support.v7.widget.RecyclerView
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/rvImage"
android:layout_width="match_parent"
android:layout_height="match_parent"
/>
</LinearLayout>
のLinearLayoutは、私は思うが、RelativeLayoutは –
ご提案いただきありがとうございますすることができ、それが私のために動作することはできません。 –