I'm setting up a layout here and after including the property: android: layout_weight , eclipse returns a warning: 'nested weights bad for performance'.
Why working with this property is bad for performance? And to what extent, will this influence performance?
Thank you.
<?xml version="1.0" encoding="utf-8"?>
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent" >
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical" >
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="horizontal"
android:layout_weight="1">
<TextView
android:id="@+id/tv_codProduto"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="0.3" //Advertência aparece aqui
android:text="Código Produto:" />
<TextView
android:id="@+id/tv_descProduto"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="0.7"
android:text="Descrição:" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="horizontal"
android:layout_weight="1">
<EditText
android:id="@+id/et_codProduto"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="0.3" //Advertência aparece aqui
android:inputType="none"/>
<EditText
android:id="@+id/et_descProduto"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="0.7"
android:inputType="none"/>
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<TextView
android:id="@+id/tv_complemento"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Complemento:"/>
<EditText
android:id="@+id/ed_complemento"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:inputType="none"/>
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="horizontal"
android:layout_weight="1">
<TextView
android:id="@+id/tv_qtdeEstoque"
android:layout_weight="0.5" //Advertência aparece aqui
android:layout_width="match_parent"
android:layout_height="match_parent"
android:text="Estoque:"
android:inputType="none"/>
<TextView
android:id="@+id/tv_vrVenda"
android:layout_weight="0.5"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:text="Valor de Venda:"/>
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="horizontal"
android:layout_weight="1">
<EditText
android:id="@+id/ed_qtdeEstoque"
android:layout_width="0dp"
android:layout_weight="0.5" //Advertência aparece aqui
android:layout_height="wrap_content"
android:inputType="none"/>
<EditText
android:id="@+id/ed_vrVenda"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="0.5"
android:ems="10" />
</LinearLayout>
<LinearLayout
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent">
<TextView
android:id="@+id/tv_fornecedor"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:text="Fornecedor:"/>
<EditText
android:id="@+id/ed_fornecedor"
android:layout_height="match_parent"
android:layout_width="match_parent"
android:inputType="none"/>
</LinearLayout>
</LinearLayout>