У меня есть один LinearLayout, в котором есть два компонента: SquareLayout, а второй - RecyclerView, я хочу SquareLayout в центре экрана и RecyclerView в нижней части экрана, не знаю, почему, но гравитация не работает для его установки. Я новичок в android. Надеюсь, мой вопрос ясен. Вот мой .xml файл.set LinearLayout on center android
<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 может –
Спасибо за ваше предложение, он будет работать для меня. –