पर कस्टम लेआउट जोड़ें मैंने अपने ऐप को कुछ टैब के साथ एक नियमित टूलबार देने के लिए इस tutorial का पालन किया।टूलबार
मैं उपकरण पट्टी को बदलना चाहते हैं, तो यह अधिक इस तरह दिखता है:
मैं उपकरण पट्टी में कुछ पाठ और छवियों को जोड़ना चाहते हैं। मैं यह कैसे कर सकता हूँ?
activity_main.xml
:
<?xml version="1.0" encoding="utf-8"?>
<android.support.design.widget.CoordinatorLayout
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.support.design.widget.AppBarLayout
android:id="@+id/appbar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar"
app:elevation="0dp">
<android.support.v7.widget.Toolbar
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="@+id/toolbar"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
android:background="@color/primary"
app:layout_scrollFlags="scroll|enterAlways"
app:theme="@style/ToolbarTheme"
app:popupTheme="@style/ThemeOverlay.AppCompat.Light"
/>
<android.support.design.widget.TabLayout
android:id="@+id/tabs"
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:tabTextAppearance="@style/TabLayout"
app:tabSelectedTextColor="@color/white"
/>
</android.support.design.widget.AppBarLayout>
<android.support.v4.view.ViewPager
android:id="@+id/pager"
android:layout_width="match_parent"
android:layout_height="match_parent"
app:layout_behavior="@string/appbar_scrolling_view_behavior"
/>
</android.support.design.widget.CoordinatorLayout>
यह एक एकल लाइन टूलबार है, अन्य जानकारी एक ही पृष्ठभूमि रंग के साथ केवल रैखिक लेआउट है। इसके अलावा आप टूलबार के अंदर दृश्य जोड़ सकते हैं बस एक बंद टैग ' android.support.v7.widget.Toolbar> ' –
NaviRamyle
यदि मैं टूलबार टैग के भीतर लेआउट जोड़ता हूं, क्या व्यवहार बदलता है? यदि टूलबार 500 पिक्सेल लंबा है तो क्या होगा? – user5374735
अप्रत्यक्ष डुप्लिकेट [एंड्रॉइड में नीचे टूलबार बनाने का सबसे अच्छा तरीका]] (http://stackoverflow.com/questions/30063426/best-way-to-create-a-bottom-toolbar-in-android) – Elltz