2013-04-22 26 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的简单布局,您也应该在那里看到红点。