【发布时间】:2013-04-10 14:46:22
【问题描述】:
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="?android:attr/listPreferredItemHeight"
android:gravity="center_vertical"
android:orientation="horizontal"
>
<ImageView
android:id="@+id/file_icon"
style="@style/fileChooserIcon"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:contentDescription="@string/desc" />
<TextView
android:id="@+id/file_name"
style="@style/fileChooserName"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
/>
错误:This tag and its children can be replaced by one <TextView/> and a compound drawable
我是 android 新手,不完全理解错误是什么。某些解决方案很难使它复合但没有得到它。
【问题讨论】:
-
这不是错误......这是lint提示
-
会影响项目吗?
-
我们最好听听这些提示(查看 Raghav Sood 的回答)...但有时我们可以忽略它们...在这个特定示例中,您可以获得性能提升(如果您使用提示)特别是如果您在 ListView 中使用此布局
-
为什么要投反对票?这是一个有效的问题