我正在使用Android Spinner Wheel,我已经为此设置了代码。
AbstractWheel wheelHorizontalView1 = (AbstractWheel) findViewById(R.id.wheelHorizontalView1);
NumericWheelAdapter minAdapter = new NumericWheelAdapter(this, 1, 15,"%01d");
minAdapter.setItemResource(R.layout.wheel_text_centered_dark_back);
minAdapter.setItemTextResource(R.id.text);
wheelHorizontalView1.setViewAdapter(minAdapter);
这是它的样子:
所以,我的问题是如何获得 3 作为我选择的文本?
如果需要,这里是 xml,
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="20dp"
android:layout_marginRight="20dp"
android:layout_marginTop="20dp">
<View
android:layout_width="40dp"
android:layout_height="40dp"
android:layout_centerHorizontal="true"
android:layout_marginTop="65dp"
android:background="#007704" />
<com.spinnerwheel.WheelHorizontalView
android:id="@+id/wheelHorizontalView1"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:layout_marginTop="60dp"
app:selectionDivider="@android:color/white"
app:selectionDividerWidth="2dp"
app:visibleItems="6" />
</RelativeLayout>