1. 程式人生 > >android仿ios的時間滾動控制元件WheelView

android仿ios的時間滾動控制元件WheelView

  <LinearLayout

        android:layout_width="200dp"
        android:orientation="horizontal"
        android:layout_gravity="center_horizontal"
        android:layout_height="wrap_content">
        <TextView
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
android:layout_gravity="center_vertical" android:textColor="#000000" android:textSize="16sp" android:text="時間:" /> <com.sds.smarthome.widget.wheeltime.WheelView android:id="@+id/wv_hour" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_weight="1" /> <com.sds.smarthome.widget.wheeltime.WheelView android:id="@+id/wv_minute" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_weight="1"
/> </LinearLayout>
        一個代表小時一個代表分鐘

wvHour.setAdapter(new NumericWheelAdapter(00, 24));
wvHour.setLabel(“時”);
其實很簡單吧