ListView视图中特定元素上的ListView选择器

时间:2014-08-15 01:22:37

标签: android listview android-listview

我遇到了一个问题,我希望listview的每个子视图都拥有自己的自定义选择器。已经有一些解决方案,但它们似乎根本不适用于我。这是我的列表视图和个人视图的xml。有谁知道我需要做什么?现在如果我可以让show_group_actions和action_calendar让单独的选择器工作,我会很高兴...

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
              android:layout_width="match_parent"
              android:layout_height="wrap_content"
              android:descendantFocusability="afterDescendants"
              android:orientation="vertical">

    <LinearLayout
        android:id="@+id/action_show_group_actions"
        style="@style/AppTheme.NavigationDrawer.Row"
        android:paddingRight="0dp"
        >

        <TextView
            android:id="@+id/group_name"
            style="@style/AppTheme.NavigationDrawer.Row.TextView"
            android:text="@string/label_my_groups"
            />

        <RelativeLayout
            style="@style/AppTheme.NavigationDrawer.Group.OpenClose"
            >

            <me.magneto.groups.views.IconView
                android:id="@+id/action_show_group_actions_arrow"
                style="@style/AppTheme.NavigationDrawer.Group.OpenClose.Arrow"
                android:text="@string/icon_chevron_down"/>
        </RelativeLayout>
    </LinearLayout>
    <LinearLayout
        android:id="@+id/action_calendar"
        style="@style/AppTheme.NavigationDrawer.Group.Row"
        >

        <me.magneto.groups.views.IconView
            style="@style/AppTheme.NavigationDrawer.Group.IconView"
            android:text="@string/icon_calendar"
            />

        <TextView
            style="@style/AppTheme.NavigationDrawer.Row.TextView"
            android:text="@string/label_calendar"/>
    </LinearLayout>
</LinearLayout>


<ListView
    android:id="@+id/navigation_drawer_list_view"
    xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:listSelector="@null"
    android:background="@color/navigation_primary_background"
    />

Each row has a unique selector, xml it's a block

0 个答案:

没有答案