我创建了一个带有标题和底部导航视图的布局,整个内容将位于中间..但是android上的设置有自己的设计..问题是,我想和一个设置图标来底部导航视图,但是当我点击设置图标时,设计不应该改变。
这是设置设计代码:
<?xml version="1.0" encoding="utf-8"?>
<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android" >
<PreferenceCategory android:title="@string/pref_update_setting" >
<CheckBoxPreference
android:defaultValue="true"
android:key="prefNotif"
android:title="@string/notif" />
<Preference
android:key="mytime"
android:title="@string/pref_user_time" />
</PreferenceCategory>
<PreferenceCategory android:title="@string/pref_other" >
<Preference
android:key="about"
android:title="@string/title_about" >
</Preference>
</PreferenceCategory>
</PreferenceScreen>
我所有布局的设计:
<?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"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#fff"
tools:context="com.xxx.xxxx.xxxx">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="50dp"
android:id="@+id/topBar"
android:background="@drawable/bottom_menu_line">
<TextView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:text="Authors"
android:textColor="#000"
android:textSize="20dp"
android:textStyle="bold"
android:gravity="center"/>
</RelativeLayout>
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:id="@+id/contentspace"
android:layout_above="@id/bottomBar"
android:layout_below="@id/topBar">
<!-- Content area -->
</RelativeLayout>
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="50dp"
android:id="@+id/bottomBar"
android:layout_alignParentBottom="true">
<android.support.design.widget.BottomNavigationView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:id="@+id/bottomNavigationBar"
app:itemIconTint="@color/colorPrimaryDark"
app:itemTextColor="@color/colorPrimaryDark"
android:background="@drawable/top_menu_line"
app:menu="@menu/bottom_navigation_menu">
</android.support.design.widget.BottomNavigationView>
</RelativeLayout>
</RelativeLayout>
</android.support.design.widget.CoordinatorLayout>
我希望问题很清楚.. 提前谢谢。