2015-10-05 20 views
0

我工作的定製DateTimePicker在Android中,這表明今天,明天,後天的標籤後,每一天定製的DateTimePicker的Android

顯示自己的時隙

Grofers應用

我爲googled第三方庫,我無法找到它。

請幫忙。

在此先感謝。

enter image description here

回答

1

您需要創建一個自定義對話框,在這裏你添加一個

<NumberPicker 
     android:id="@+id/numberPicker1" 
     android:layout_width="wrap_content" 
     android:layout_height="wrap_content" 
     android:layout_alignParentTop="true" 
     android:layout_centerHorizontal="true" 
     android:layout_marginTop="64dp" /> 

您可以輸入自定義的數據進去,設置一天的最小值和最大值,這將是一個你自己的看法0和2,然後設置顯示值,這是一個簡單的字符串數組。有關數字選擇器的更多信息,請參閱http://developer.android.com/reference/android/widget/NumberPicker.html

+0

您能幫我解釋一些示例代碼嗎? –

+0

看到http://stackoverflow.com/questions/17805040/how-to-create-a-number-picker-dialog – Aegis

+0

讓我試試這個 –