Я делаю XML-файл макета, состоящий из 3 частей:
Часть 1: немного информации и изображения о месте.
Часть 2: два горизонтальных Button
с.
Часть 3: RecyclerView
отзывов некоторых людей.
Это мой файл макета:
<ScrollView
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:name="com.example.abdo.foodproject.OneItemFragment"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context="com.example.abdo.foodproject.OneItemFragment"
tools:layout="@layout/activity_item"
>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@drawable/oneitem_background_theme"
android:orientation="vertical"
android:weightSum="13"
>
<LinearLayout>
(...) <!--part 1-->
</LinearLayout>
<LinearLayout <!--part 2-->
android:layout_width="match_parent"
android:layout_height="wrap_content">
<Button
android:id="@+id/review_list"
android:layout_width="0dp"
android:layout_weight="1"
android:layout_height="wrap_content"
android:text="@string/reviews"
android:background="@color/colorPrimaryDark"
/>
<Button
android:id="@+id/bestMeal_list"
android:layout_width="0dp"
android:layout_weight="1"
android:layout_height="wrap_content"
android:background="@color/colorPrimaryLight"
android:text="@string/best_meal"
/>
</LinearLayout>
<android.support.v7.widget.RecyclerView <!--part 3-->
android:id="@+id/recyclerViewItem"
android:layout_width="match_parent"
android:layout_height="match_parent">
</android.support.v7.widget.RecyclerView>
</LinearLayout>
Я хочу, чтобы кнопки фиксировались на моем экране в верхней части окна, не теряя при этом их прокрутки.
Кто-нибудь знает, как это сделать?