Option 1 - Linear Layout:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:orientation="vertical">
<include
layout="@layout/app_bar"/>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1">
<android.support.design.widget.NavigationView
android:id="@+id/nav_view"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_gravity="start"
android:fitsSystemWindows="true"
app:headerLayout="@layout/header_main"
app:menu="@menu/activity_main_drawer"
android:background="@color/colorBlue"
app:itemTextColor="@drawable/drawer_item"
app:itemBackground="@drawable/selector_menu"
app:itemTextAppearance="@style/MenuItem"
app:paddingStart="@dimen/space8"/>
</LinearLayout>
<com.google.android.gms.ads.AdView xmlns:ads="http://schemas.android.com/apk/res-auto"
android:id="@+id/adView"
android:layout_width="match_parent"
android:layout_height="wrap_content"
ads:adSize="BANNER"
ads:adUnitId="xxxxxx" />
</LinearLayout>
Option 2 - Constraintlayout:
<?xml version="1.0" encoding="utf-8"?>
<android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<include layout="@layout/app_bar" />
<android.support.design.widget.NavigationView
android:id="@+id/nav_view"
android:layout_width="match_parent"
android:layout_height="0dp"
android:background="@color/colorBlue"
android:fitsSystemWindows="true"
app:headerLayout="@layout/header_main"
app:itemBackground="@drawable/selector_menu"
app:itemTextAppearance="@style/MenuItem"
app:itemTextColor="@drawable/drawer_item"
app:layout_constraintBottom_toTopOf="@+id/adView"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toBottomOf="@id/toolbar"
app:menu="@menu/activity_main_drawer"
app:paddingStart="@dimen/space8" />
<com.google.android.gms.ads.AdView xmlns:ads="http://schemas.android.com/apk/res-auto"
android:id="@+id/adView"
android:layout_width="match_parent"
android:layout_height="wrap_content"
ads:adSize="BANNER"
ads:adUnitId="xxxxxx"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent" />
</android.support.constraint.ConstraintLayout>
And what’s your Activity on? Relative Layout, Linear Layout...?
– Murillo Comino
it’s just this way even...
– user148974
I even tried to paste inside a <Linearlayout android:layout_width="wrap_content" android:layout_height="match_parent"> but it didn’t even show up anymore
– user148974