हाय मैं छोटे एंड्रॉइड एप्लिकेशन को विकसित कर रहा हूं जिसमें मैं 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
के शीर्ष पर दिखाना चाहता हूं। क्या मुझे कुछ याद आ रहा है या कुछ गलत कर रहा है। कुछ मदद की जरूरत है। धन्यवाद।
ऊंचाई चाल :) करता है –