2013-10-28 24 views

回答

2

看看這個project

在這種情況下,他只能去除週日但可以調整它也除去週六,就像這樣:

if (choosenDate.get(Calendar.DAY_OF_WEEK) == 
        Calendar.SUNDAY || Calendar.DAY_OF_WEEK) == 
        Calendar.SATURDAY || 
        now.compareTo(choosenDate) < 0) { 
        dateTextView.setTextColor(
         Color.parseColor("#ff0000") 
        ); 
        ((Button) dialog.getButton(
        AlertDialog.BUTTON_POSITIVE)) 
         .setEnabled(false); 
       } 

希望它能幫助。

*硬是阻止可供選擇它們的用戶,但我認爲你可以將其隱藏像這裏面你如果:

dateTextView.setVisibility(View.GONE); 
+0

我想,鏈接代碼,但它包含錯誤。我現在使用日期滑塊並試圖跳過週末。 –

相關問題