5
こんにちは私はAppBarLayout
でツールバーを表示しようとしている小さなアンドロイドアプリケーションを開発しています。私は私のツールバーの上にいくつかのビューを表示したい。私は、次の方法でこれを試してみました: AndroidウィジェットAppBarLayoutは常に上に来る
<?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>
は、したがって、上記のレイアウトでは、後に、両方の相対的なレイアウトは私のAppBarLayout
下に来る
toolbar_view
の上に示したいと思います。私は何かを欠いているか、何か間違っている。助けが要る。ありがとうございました。
標高はトリックを行います:) –