2017-02-19 64 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

仍爲空我的朋友 –