2011-12-03 27 views
0

我使用layoutopt來增強佈局並識別其中的低效率。我收到以下消息,layoutopt輸出的含義

F:\Trunk\AndroidApp\Pixecon\res\layout-land\take_photo.xml 
182:215 This RelativeLayout layout or its RelativeLayout parent is possibly useless 

佈局文件take_photo.xm升如下

<RelativeLayout       //  line 179 
    android:id="@+id/rview4"     //  line 180 
    android:layout_width="fill_parent"  //  line 181 
    android:layout_height="162dp" >   //  line 182 

     <ListView android:id="@+id/ListView01" 
     android:layout_height="fill_parent"  
     android:layout_marginLeft="5dp"   
     android:cacheColorHint="#00000000"       
     android:transcriptMode="alwaysScroll" android:layout_width="160dip"/> 

     <RelativeLayout android:id="@+id/coverFlowBlock" 
     android:layout_width="wrap_content" 
     android:layout_toRightOf="@+id/ListView01" 
     android:layout_marginRight="5dp" 
     android:layout_height="wrap_content"> 

      <ImageView android:id="@+id/spacer3" 
      android:layout_width="fill_parent" 
      android:layout_alignParentBottom="true" 
      android:layout_height="5dp" 
      android:src="@drawable/spacer" />    

      <ImageView android:id="@+id/spacer2" 
      android:layout_width="fill_parent" 
      android:layout_height="5dp" 
      android:src="@drawable/spacer" ></ImageView> 

      <com.pixecon.CoverFlow android:id="@+id/coverFlow"     
      android:layout_width="310dp" 
      android:layout_below="@+id/spacer2" 
      android:layout_above="@+id/spacer3" 
      android:layout_height="fill_parent" /> 

     </RelativeLayout> 

    </RelativeLayout>        // line 215 

輸出的layoutoptRelativeLayout可能是無用的,所以我應該要刪除此相對佈局? 我很困惑它到底意味着什麼,所以請任何人幫助我理解這一點。

回答

0

閱讀這裏:Layout optimization

這樣的錯誤輸出是未使用或廢棄指令的結果 建議:嘗試儘可能減少你的XML只留下最重要的部分。這是相對較大的xml文件的常見問題,有時你會丟失並移動,所以會導致很多未使用的代碼