这是我在android上的第一个应用程序/项目,我即时学习。我在lint中有一个警告:“youramounts.xml有超过80个视图,对性能不利”我知道这个问题背后的逻辑,而不是如何纠正它。我如何纠正这个错误?我应该有不同于线性布局的布局吗?应该为我的应用使用哪种布局?皮特错误?
我已阅读列表视图和网格视图的几篇文章,但我不理解如何将它们应用到我的应用程序。显示的图像是我想要应用程序的外观。我已经开始尝试列表和网格视图。我目前用网格视图替换了前两个表格行,看看会发生什么,我在这一点上毫无头绪,所以我删除了网格视图并恢复为表格行。但这里是布局编码和表格行的设置,我有11个表格行和一个没有在编码中显示的按钮!感谢您提前提出任何意见!
[1]: http://i.stack.imgur.com/W`<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="vertical" >
<TableRow
android:id="@+id/EjuiceNicotine"
android:layout_width="wrap_content"
android:layout_height="50dp" >
<TextView
android:id="@+id/EjuiceNicotineText"
android:layout_width="145dp"
android:layout_height="wrap_content"
android:text="@string/e_juice_nicotine" />
<TextView
android:id="@+id/TextView01"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/pg" />
<EditText
android:id="@+id/editText1"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:inputType="number" />
<TextView
android:id="@+id/textView2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/Percent" />
<TextView
android:id="@+id/textView3"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/vg" />
<EditText
android:id="@+id/EditText01"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:inputType="number" />
<TextView
android:id="@+id/TextView02"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/Percent" />
<EditText
android:id="@+id/editText2"
android:layout_width="27dp"
android:layout_height="wrap_content"
android:ems="10"
android:inputType="number" />
<TextView
android:id="@+id/textView1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/mg" />
</TableRow>
http://i.stack.imgur.com/jzJxM.png
你可以使用列表视图 – Raghunandan
我应该坚持使用线性布局还是使用类似于相对布局的东西? – BobbyG