如何创建滚动日历选项卡

时间:2013-07-17 05:33:53

标签: android

如何创建滚动标签日历,以便当用户点击一周中的任何一天时,新标签将显示如此图像,如此图像http://imgur.com/pXMrFmn任何示例或应用程序你知道会这样做吗???我想创建具有此类型日历的应用程序,以便当用户点击日期数据显示的任何日期时请帮助我。]

  DateFormat fmtDateAndTime = DateFormat.getDateInstance();
Calendar myCalendar = Calendar.getInstance();

DatePickerDialog.OnDateSetListener d = new DatePickerDialog.OnDateSetListener() {
public void onDateSet(DatePicker view, int year, int monthOfYear,int dayOfMonth) {
myCalendar.set(Calendar.YEAR, year);
myCalendar.set(Calendar.MONTH, monthOfYear);
myCalendar.set(Calendar.DAY_OF_MONTH, dayOfMonth);

edtKeyword.setText( (monthOfYear + 1) + "-" + dayOfMonth + "-" + year);




    edtKeyword.setOnClickListener(new View.OnClickListener() {
        @Override
        public void onClick(View v) {
            new DatePickerDialog(MenuList.this, d, myCalendar
                    .get(Calendar.YEAR), myCalendar.get(Calendar.MONTH),
                    myCalendar.get(Calendar.DAY_OF_MONTH)).show();

             mYear = myCalendar.get(Calendar.YEAR);
                 mMonth = myCalendar.get(Calendar.MONTH);
                mDay = myCalendar.get(Calendar.DAY_OF_MONTH);



            selectedDate= mDay+"-"+mMonth+"-"+mYear;
            edtKeyword.setText(selectedDate);

            edtKeyword.invalidate();



        }
       });

0 个答案:

没有答案