我对我的ListView行自定义视图使用以下布局。我怎样才能让ListView的行中的一个子线性布局在点击时不突出显示
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical" >
<LinearLayout
android:duplicateParentState="false"
android:clickable="false"
android:id="@+id/header"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="horizontal" >
<!-- A lot of text views -->
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="horizontal"
android:minHeight="48dp" >
<!-- A lot of text views -->
</LinearLayout>
</LinearLayout>
通过使用android:duplicateParentState="false"
和android:clickable="false"
,我期待的header
的LinearLayout被点击列表视图排时就不会突出显示。
但是,它仍然被强调。我可否知道我怎样才能让header
LinearLayout不突出显示?以除去视觉亮点
这不是标题视图。虽然它的id被命名为“header”,但它可以出现在单个列表视图中的多行中。 – 2013-04-23 09:13:34
啊哈,对不起,我看错了。您是否尝试过@laalto建议的解决方案?这应该工作。 – traninho 2013-04-23 09:19:58