मैं एक एंड्रॉइड ऐप पर काम कर रहा हूं और डिज़ाइन लाइब्रेरी से BottomNavigationView
लागू कर रहा हूं। मैंने कई उदाहरण देखे हैं और मैं यह नहीं समझ सकता कि मेरे लेआउट में क्या गलत है। BottomNavigationView
पूर्ण चौड़ाई के रूप में प्रदर्शित नहीं होता है।BottomNavigationView पूर्ण चौड़ाई नहीं है
एक और मुद्दा स्टेटस बार रंग लागू नहीं हो रहा है।
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">
<!-- Include the toolbar -->
<include layout="@layout/toolbar"/>
<RelativeLayout android:id="@+id/fragment_container"
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"/>
<android.support.design.widget.BottomNavigationView
android:id="@+id/bottom_navigation"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_gravity="bottom"
app:itemBackground="@color/colorPrimary"
app:itemIconTint="@android:color/white"
app:itemTextColor="@android:color/white"
app:menu="@menu/bottom_navigation_main"/>
</android.support.design.widget.CoordinatorLayout>
toolbar.xml
<?xml version="1.0" encoding="utf-8"?>
<android.support.design.widget.AppBarLayout
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="wrap_content"
android:theme="@style/AppTheme.AppBarOverlay">
<android.support.v7.widget.Toolbar
android:id="@+id/toolbar"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
android:background="?attr/colorPrimary"
app:popupTheme="@style/AppTheme.PopupOverlay"/>
</android.support.design.widget.AppBarLayout>
संपादित: स्थिति के लिए जोड़ा समाधान रंग सेट नहीं किया जा रहा
android:fitsSystemWindows="true"
(colorPrimaryDark) status bar color not working on android v21?
निचला नौसेना Google Play न्यूस्टैंड में पूर्ण चौड़ाई लगता है, इसलिए मैंने सोचा कि मेरे लेआउट के साथ कोई समस्या थी। मैं जल्द ही एक तीसरा मेनू आइटम जोड़ने की योजना बना रहा हूं। – midhunhk
@ मिधुनह हां यह संभव है। मैंने इसके लिए समाधान जोड़ा। लेकिन एंडी सही है, आपको डिजाइन चश्मा का पालन करना चाहिए। –