由于我是Android的新手,请帮助我在按钮单击的对话框中添加日历视图 我使用了以下但它显示了我可滚动的日期日期模式日历 但我想显示日历,如Jquery日历视图,这是月份明智我怎么能显示请帮助 通过提前显示代码来
protected Dialog onCreateDialog( int id) {// to create Date dialog
switch (id) {
case OE_DT_DIALOG_ID:
final Calendar calendar = Calendar.getInstance();
int yy = calendar.get(Calendar.YEAR);
int mm = calendar.get(Calendar.MONTH);
int dd = calendar.get(Calendar.DAY_OF_MONTH);
// set date picker as current date
return new DatePickerDialog(this, datePickerListener, yy, mm,dd);
}
return null;
}
@SuppressWarnings("unused")
private DatePickerDialog.OnDateSetListener datePickerListener = new DatePickerDialog.OnDateSetListener() {
// when dialog box is closed, below method will be called.
@SuppressWarnings("deprecation")
public void onDateSet(DatePicker view, int selectedYear,int selectedMonth, int selectedDay) {
year = selectedYear;
month = selectedMonth;
day = selectedDay;
// set selected date into btn View
lblDate.setText(new StringBuilder().append(day).append("-").append(month + 1)
.append("-").append(year).append(" "));
}
};
显示这样的日历
答案 0 :(得分:0)
您可以使用寻呼机视图执行此操作。将您的寻呼机视图设置为水平可滚动并获取每个月的实例并使用片段显示该实例。希望这会给出一个想法...
请在此处找到help。这是一个您要与代码链接的自定义库