Я пытаюсь добавить панель инструментов в макет ограничения, но вот результат, который я получаю:
Как видите, он не занимает весь экран. Вот мой xml:
<android.support.constraint.ConstraintLayout
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"
tools:context=".MainActivity">
<android.support.v7.widget.Toolbar
android:id="@+id/toolbar"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
android:background="?attr/colorPrimary"
android:theme="@style/ThemeOverlay.AppCompat.ActionBar"
app:popupTheme="@style/ThemeOverlay.AppCompat.Light">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Fragment title"/>
</android.support.v7.widget.Toolbar>
</android.support.constraint.ConstraintLayout>
Ширина и длина ConstraintLayout устанавливаются в соответствии с родительским элементом (который должен быть экраном?), а ширина панели инструментов устанавливается в соответствии с шириной макета. Что мне не хватает?