2013-04-22 45 views
0

我想請教一下層次視圖的結果。我有一個自定義組件,我粘貼下面的佈局代碼,我不明白是什麼問題?爲什麼層次結構查看器提供紅點關於佈局的性能 - HierarchyViewer

任何意見可以理解

層次視圖結果

測量:1.873毫秒 佈局:0.298毫秒 消耗:1.472毫秒

黃色/紅色/黃色

定製組件佈局

<com.ab.framework.component.ui.RelativeLayout1 
     android:id="@+id/relativeLayout1" 
     android:layout_width="fill_parent" 
     android:layout_height="wrap_content" > 

     <com.ab.framework.component.ui.TextView1 
      android:id="@+id/textMoneyRight" 
      android:layout_width="wrap_content" 
      android:layout_height="wrap_content" 
      android:layout_alignParentRight="true" 
      android:layout_marginLeft="@dimen/moneyview_item_margin" 
      android:layout_marginTop="@dimen/moneyview_TextField2_Padding" 
      android:text="@string/empty_text" 
      android:textSize="@dimen/moneyview_textField2_size" /> 

     <com.ab.framework.component.ui.TextView1 
      android:id="@+id/textMoneyLeft" 
      android:layout_width="wrap_content" 
      android:layout_height="wrap_content" 
      android:layout_marginRight="@dimen/moneyview_item_margin3x" 
      android:layout_toLeftOf="@+id/textMoneyRight" 
      android:text="@string/empty_text" 
      android:textSize="@dimen/moneyview_textField1_size" 
      android:textStyle="bold" /> 

     <com.ab.framework.component.ui.TextView1 
      android:id="@+id/textMoneySeperator" 
      android:layout_width="wrap_content" 
      android:layout_height="wrap_content" 
      android:layout_alignParentRight="false" 
      android:layout_marginTop="2dp" 
      android:layout_toLeftOf="@+id/textMoneyRight" 
      android:text="@string/price_seperator" 
      android:textStyle="bold" /> 

     <com.ab.framework.component.ui.TextView1 
      android:id="@+id/textMoneyCurrency" 
      android:layout_width="wrap_content" 
      android:layout_height="wrap_content" 
      android:layout_alignParentRight="true" 
      android:layout_below="@+id/textMoneyRight" 
      android:layout_marginTop="@dimen/moneyview_item_margin" 
      android:text="@string/currency" /> 

     <com.ab.framework.component.ui.TextView1 
      android:id="@+id/textMoneyDescription" 
      android:layout_width="wrap_content" 
      android:layout_height="wrap_content" 
      android:layout_alignParentRight="true" 
      android:layout_below="@+id/textMoneyCurrency" 
      android:layout_marginLeft="@dimen/moneyview_item_margin" 
      android:layout_marginTop="@dimen/moneyview_TextField2_Padding" 
      android:text="@string/empty_text" 
      android:textSize="@dimen/moneyview_textField2_size" /> 
    </com.ab.framework.component.ui.RelativeLayout1> 

</merge> 

回答

1

紅/黃/綠點是相對值。只有當您注意到性能存在問題時,您才應該查看它們。

嘗試使用包含TextViewImageView的簡單佈局,您也應該在那裏看到紅點。