2014-02-06 30 views
0

工作,我有以下的RelativeLayout,称之为layout_dog嵌套包括标签没有在Android的XML布局

<?xml version="1.0" encoding="utf-8"?> 
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" 
    android:layout_width="match_parent" 
    android:layout_height="match_parent" 
    android:background="@color/gray" > 

    <LinearLayout 
     android:layout_width="match_parent" 
     android:layout_height="match_parent" 
     android:layout_gravity="center_horizontal" 
     android:layout_marginLeft="20dp" 
     android:layout_marginRight="20dp" 
     android:background="@color/white" 
     android:orientation="vertical" > 

     <TextView 
      ... /> 

     <TextView 
      ... /> 

    </LinearLayout> 

    <include 
     android:layout_width="match_parent" 
     android:layout_height="wrap_content" 
     android:layout_centerInParent="true" 
     android:layout_gravity="center" 
     layout="@layout/center_overlay" /> 

</RelativeLayout> 

当我查看layout_dog在Graphical Layout一切都看起来不错。

但后来我有另一个布局文件,一个名为layout_book的LinearLayout。当layout_book中的layout_dog为include时,center_overlay不会显示在layout_book中。 有谁知道如何得到这个权利?

回答

0

实际上与Android没有问题。我包括layout_book

错误的xml文件