Android 旋转器回收视图
这是Priyatham Suresh,我是android新手 我正在使用spinner和RecyclerView。我有一行包含textView和微调器。我希望在选择微调器项目时获得RecyclerView的行位置 我最初使用了ListView,使用了onItemSelected,它提供了微调器项目位置,但无法获得行位置 这是我的行表\u settings\u row.xmlAndroid 旋转器回收视图,android,spinner,android-recyclerview,Android,Spinner,Android Recyclerview,这是Priyatham Suresh,我是android新手 我正在使用spinner和RecyclerView。我有一行包含textView和微调器。我希望在选择微调器项目时获得RecyclerView的行位置 我最初使用了ListView,使用了onItemSelected,它提供了微调器项目位置,但无法获得行位置 这是我的行表\u settings\u row.xml <?xml version="1.0" encoding="utf-8"?> <LinearLayout
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical" android:layout_width="match_parent"
android:layout_height="match_parent">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="97dp"
android:paddingTop="16dp"
android:paddingBottom="16dp"
android:id="@+id/relativeone">
<TextView
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:textAppearance="?android:attr/textAppearanceLarge"
android:text="Table Number"
android:id="@+id/tableNo_textview"
android:layout_alignParentTop="true"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true"
android:layout_marginLeft="12dp"
android:textStyle="bold"
android:textColor="#ff7c40"
android:editable="true" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginTop="30dp"
android:paddingTop="10dp">
<ImageView
android:src="@drawable/ic_person"
android:layout_width="22dp"
android:layout_height="22dp"
android:paddingLeft="10dp" />
<Spinner
android:layout_width="300dp"
android:layout_height="wrap_content"
android:id="@+id/users_spinner"
android:entries="@array/sample_members"
android:spinnerMode="dropdown"
android:paddingLeft="20dp"/>
</LinearLayout>
</RelativeLayout>
</LinearLayout>
只需将标记(位置)设置为OnBindView上的微调器即可。现在,当您选择微调器时,您可以获得该微调器的标记,这是您想要的位置。嗨,Priyatham,请检查一下。请发布您的ViewHolder实现的代码。