У меня есть этот код XML, я хочу показать текст сверху, элементы GridView
в середине и нижнюю панель навигации внизу, однако на элементах GridView
отображается нижняя панель навигации .
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout 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"
android:background="@drawable/bg_color"
android:orientation="vertical"
tools:context=".MainActivity">
<LinearLayout
android:weightSum="10"
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="2">
<TextView
android:id="@+id/hello_textView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerInParent="true"
android:fontFamily="@font/cantarell"
android:text="Welcome"
android:textColor="#fff"
android:textSize="34sp"
android:textStyle="bold" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@+id/hello_textView"
android:layout_marginLeft="50dp"
android:layout_marginRight="50dp"
android:fontFamily="@font/cantarell"
android:text="You can choose a doctor from one of our available department"
android:textAlignment="center"
android:textColor="#fff" />
</RelativeLayout>
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="8">
<GridView
android:id="@+id/dept_gridView"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_centerInParent="true"
android:layout_centerHorizontal="true"
android:layout_margin="10dp"
android:columnWidth="100dp"
android:horizontalSpacing="5dp"
android:numColumns="2"
android:stretchMode="columnWidth"
android:verticalSpacing="10dp" />
</RelativeLayout>
<com.luseen.spacenavigation.SpaceNavigationView
android:layout_alignParentBottom="true"
android:id="@+id/space_nav_bar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="bottom"
app:active_item_color="@color/colorAccent"
app:centre_button_color="@color/centre_button_color"
app:centre_button_icon="@drawable/ic_home"
app:inactive_item_color="#474389"
app:space_background_color="#fff"
app:space_item_icon_only_size="@dimen/space_item_icon_only_size"
app:space_item_icon_size="@dimen/space_item_icon_default_size"
app:space_item_text_size="@dimen/space_item_text_default_size" />
</LinearLayout>
</RelativeLayout>
Как это исправить?