Witam Zajmuję się tworzeniem małej aplikacji na Androida, w której próbuję wyświetlić pasek narzędzi z AppBarLayout
. Chcę wyświetlić jakiś widok na moim pasku narzędzi. Próbowałem to w następujący sposób:Android widget AppBarLayout zawsze jest na topie
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout 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"
tools:context="com.example.nileshkashid.samplesearchbarapplication.Main2Activity">
<android.support.design.widget.AppBarLayout
android:id="@+id/toolbar_view"
android:layout_width="match_parent"
android:layout_height="wrap_content"
>
<android.support.v7.widget.Toolbar
android:id="@+id/toolbar"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
android:background="@android:color/transparent"
/>
</android.support.design.widget.AppBarLayout>
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="150dp"
android:background="@android:color/holo_red_dark"
></RelativeLayout>
<RelativeLayout
android:layout_width="150dp"
android:layout_height="150dp"
android:background="@android:color/holo_green_dark"
></RelativeLayout>
</RelativeLayout>
Tak więc w powyższym układzie później oba względne układy przychodzi pod moim AppBarLayout
. Ale chcę pokazać je na moim toolbar_view
. Czy brakuje mi czegoś lub robię coś nie tak. Potrzebuję pomocy. Dziękuję Ci.
elewacja robi trick :) –