2017-02-19 100 views
0

我正在使用导航抽屉。但我的布局看起来很空虚。任何想法解决?为什么它看起来像空?这是我的代码。我不分享我的Java代码,因为我不认为问题在那里。使用空布局包括

app_bar_ipuclari.xml

<?xml version="1.0" encoding="utf-8"?> 
<android.support.design.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android" 
xmlns:tools="http://schemas.android.com/tools" 
xmlns:app="http://schemas.android.com/apk/res-auto" 
android:layout_width="match_parent" 
android:layout_height="match_parent" 
android:fitsSystemWindows="true" 
tools:context="com.example.yunus.ototakip.IpuclariSayfasi"> 

<android.support.design.widget.AppBarLayout 
    android:layout_width="match_parent" 
    android:layout_height="wrap_content" 
    android:theme="@style/AppTheme.AppBarOverlay"> 

</android.support.design.widget.AppBarLayout> 

<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" 
    app:titleTextColor="@color/beyaz" 
    app:subtitleTextColor="@color/beyaz"> 
    </android.support.v7.widget.Toolbar> 
<RelativeLayout 
    android:layout_width="match_parent" 
    android:layout_marginTop="56dp" 
    android:background="@color/colorAccent" 
    android:id="@+id/tarihView" 
    android:layout_height="35dp"> 

    <TextView android:layout_width="wrap_content" 
     android:layout_height="wrap_content" 
     android:text="Bugün -" 
     android:textColor="@color/beyaz" 
     android:fontFamily="sans-serif-light" 
     android:layout_centerVertical="true" 
     android:layout_alignParentStart="true" 
     android:layout_marginStart="11dp" 
     android:textSize="18sp" 
     android:paddingLeft="11dp" 
     android:id="@+id/tarihText"> 


    </TextView> 
</RelativeLayout> 

<android.support.design.widget.BottomNavigationView 
android:id="@+id/bottom_navigation" 
android:layout_width="match_parent" 
android:layout_height="wrap_content" 
android:layout_gravity="bottom|end" 
app:itemBackground="@color/colorPrimary" 
app:itemIconTint="@color/beyaz" 
app:itemTextColor="@color/beyaz" 
app:menu="@menu/bottombar_menu" /> 

<include layout="@layout/content_ipuclari_sayfasi"/> </android.support.design.widget.CoordinatorLayout> 

content_ipuclari_sayfasi.xml

<?xml version="1.0" encoding="utf-8"?> 
<RelativeLayout 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:id="@+id/content_ipuclari_sayfasi" 
android:layout_width="match_parent" 
android:layout_height="match_parent" 
app:layout_behavior="@string/appbar_scrolling_view_behavior" 
tools:context="com.example.yunus.ototakip.IpuclariSayfasi" 
tools:showIn="@layout/app_bar_ipuclari"> 


<CheckBox 
    android:text="CheckBox" 
    android:layout_width="wrap_content" 
    android:layout_height="wrap_content" 
    android:layout_alignParentTop="true" 
    android:layout_alignParentStart="true" 
    android:layout_marginStart="132dp" 
    android:layout_marginTop="257dp" 
    android:id="@+id/checkBox" /></RelativeLayout> 

activity_ipuclari_sayfasi.xml

<?xml version="1.0" encoding="utf-8"?> 
<android.support.v4.widget.DrawerLayout 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:id="@+id/drawer_layout" 
android:layout_width="match_parent" 
android:layout_height="match_parent" 
android:fitsSystemWindows="true" 
tools:openDrawer="start"> 

<include 
    layout="@layout/app_bar_main" 
    android:layout_width="match_parent" 
    android:layout_height="match_parent" /> 

<android.support.design.widget.NavigationView 
    android:id="@+id/nav_view" 
    android:layout_width="wrap_content" 
    android:layout_height="match_parent" 
    android:layout_gravity="start" 
    android:fitsSystemWindows="true" 
    app:headerLayout="@layout/nav_header_main" 
    app:menu="@menu/activity_main_drawer"/> 

回答

0

在你app_bar_ipuclari.xml文件你没有关闭标签

<include layout="@layout/content_ipuclari_sayfasi"/ 

到底添加此>

也尽量工具栏进入AppBarLayout

+0

有xml文件中/>标签。更新* –

+0

然后尝试移动工具栏 –

+0

仍为空我的朋友 –