2017-03-17 11 views
1

私は正しく表示されるレイアウトを持っていますが、DrawerLayoutを追加した後、私の古いレイアウトは隠されていました。 2歳のレイアウトの古いレイアウトを表示するにはどうすればいいですか?

<?xml version="1.0" encoding="utf-8"?> 
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" 
    android:layout_width="match_parent" 
    android:orientation="vertical" 
    android:weightSum="2" 
    android:layout_height="match_parent"> 
    <android.support.v4.widget.DrawerLayout 
     android:id="@+id/drawer_layout" 
     android:layout_width="match_parent" 
     android:layout_height="match_parent"> 
     <RelativeLayout 
      android:layout_width="wrap_content" 
      android:layout_height="wrap_content"> 
      <include 
       android:id="@+id/activity_base" 
       layout="@layout/activity_base" 
       android:layout_width="match_parent" 
       android:layout_height="wrap_content" /> 
      <LinearLayout 
       android:layout_width="match_parent" 
       android:layout_height="0dp" 
       android:layout_weight="1" 
       android:orientation="horizontal" 
       android:weightSum="2"> 
       <RelativeLayout 
        android:id="@+id/resturantlayout" 
        android:layout_width="0dp" 
        android:layout_marginTop="10dp" 
        android:layout_marginRight="5dp" 
        android:layout_marginLeft="10dp" 
        android:layout_marginBottom="5dp" 
        android:layout_height="match_parent" 
        android:layout_weight="1" 
        android:background="#bd4304"> 
        <TextView 
         android:text="رستوران" 
         android:layout_marginTop="10dp" 
         android:layout_width="wrap_content" 
         android:layout_height="wrap_content" 
         android:id="@+id/txtresturant" 
         android:textSize="18sp" 
         android:textStyle="normal|bold" 
         android:layout_centerHorizontal="true" 
         android:layout_below="@+id/imageButtonresturant" /> 
        <ImageButton 
         android:layout_width="150dp" 
         android:layout_height="150dp" 
         android:layout_centerHorizontal="true" 
         android:layout_alignParentTop="true" 
         android:layout_marginTop="30dp" 
         android:background="@drawable/resturantlogo" 
         android:id="@+id/imageButtonresturant" 
         android:scaleType="fitXY" 
         /> 
       </RelativeLayout> 
       <RelativeLayout 
        android:id="@+id/coffeshoplayout" 
        android:layout_width="0dp" 
        android:layout_height="match_parent" 
        android:layout_weight="1" 
        android:layout_marginTop="10dp" 
        android:layout_marginRight="10dp" 
        android:layout_marginLeft="5dp" 
        android:layout_marginBottom="5dp" 
        android:background="#d2ae6d"> 
        <ImageButton 
         android:layout_width="150dp" 
         android:layout_height="150dp" 
         android:layout_centerHorizontal="true" 
         android:layout_alignParentTop="true" 
         android:layout_marginTop="30dp" 
         android:background="@drawable/cofeelogo" 
         android:id="@+id/imageButtencofee" 
         /> 
        <TextView 
         android:text="کافه ها" 
         android:layout_marginTop="13dp" 
         android:layout_width="wrap_content" 
         android:layout_height="wrap_content" 
         android:id="@+id/textViewcofee" 
         android:textStyle="normal|bold" 
         android:textSize="18sp" 
         android:layout_below="@+id/imageButtencofee" 
         android:layout_centerHorizontal="true" /> 
       </RelativeLayout> 
      </LinearLayout> 
      <LinearLayout 
       android:id="@+id/servfoodlayout" 
       android:layout_width="match_parent" 
       android:layout_height="0dp" 
       android:layout_weight="1" 
       android:orientation="horizontal" 
       android:weightSum="2"> 
       <RelativeLayout 
        android:layout_width="0dp" 
        android:layout_height="match_parent" 
        android:layout_weight="1" 
        android:layout_marginTop="5dp" 
        android:layout_marginRight="5dp" 
        android:layout_marginLeft="10dp" 
        android:layout_marginBottom="10dp" 
        android:background="#f58634"> 
        <ImageButton 
         android:layout_width="150dp" 
         android:layout_height="150dp" 
         android:layout_centerHorizontal="true" 
         android:layout_alignParentTop="true" 
         android:layout_marginTop="30dp" 
         android:background="@drawable/ghazalogo" 
         android:id="@+id/imageButtonghaza" /> 
        <TextView 
         android:text="غذای آماده" 
         android:layout_width="wrap_content" 
         android:layout_height="wrap_content" 
         android:textStyle="normal|bold" 
         android:textSize="18sp" 
         android:id="@+id/textViewgghaza" 
         android:layout_below="@+id/imageButtonghaza" 
         android:layout_centerHorizontal="true" 
         android:layout_marginTop="10dp" /> 
       </RelativeLayout> 
       <RelativeLayout 
        android:layout_width="0dp" 
        android:layout_height="match_parent" 
        android:layout_weight="1" 
        android:layout_marginTop="5dp" 
        android:layout_marginRight="10dp" 
        android:layout_marginLeft="5dp" 
        android:layout_marginBottom="10dp" 
        android:background="#7db446"> 
        <TextView 
         android:text="فست فود" 
         android:layout_width="wrap_content" 
         android:layout_height="wrap_content" 
         android:id="@+id/textView3" 
         android:layout_marginTop="10dp" 
         android:textStyle="normal|bold" 
         android:textSize="18sp" 
         android:layout_below="@+id/imageButtonfastfood" 
         android:layout_centerHorizontal="true" /> 
        <ImageButton 
         android:layout_width="150dp" 
         android:layout_height="150dp" 
         android:layout_centerHorizontal="true" 
         android:layout_alignParentTop="true" 
         android:layout_marginTop="30dp" 
         android:background="@drawable/fastfoodlogo" 
         android:id="@+id/imageButtonfastfood" 
         /> 
       </RelativeLayout> 
      </LinearLayout> 
     </RelativeLayout> 
     <FrameLayout 
      android:id="@+id/drawer_frame_layout" 
      android:layout_width="match_parent" 
      android:layout_height="match_parent" 
      android:layout_gravity="right" 
      android:layout_marginLeft="56dp" 
      android:choiceMode="singleChoice" 
      android:dividerHeight="1dp" /> 
    </android.support.v4.widget.DrawerLayout> 
</LinearLayout> 

IDは以下のとおりです:彼らは正しいことが示されたことを「cofeeshoprow、servfoodlayout」ここで引き出しを追加した後、私のコードです。

+0

どのような体でも役に立ちますか? – mahtab

答えて

0

"activity_base"の下に表示するレイアウトには、android:layout_below="@+id/activity_base"を使用してください。一般的に、この場合、 "android:layout_below"を使用してレイアウトを一致させてください。

関連する問題