5

我的应用程序是关于回历(伊斯兰)日历,但默认的 android CalendarView 是公历!如何自定义 Android 日历视图?!

我需要这样的东西:

在此处输入图像描述

4

1 回答 1

4

您好,请访问所有给定的链接,希望对您有所帮助

1. https://github.com/inteist/android-better-time-picker

2. https://github.com/derekbrameyer/android-betterpickers

3. http://www.androiddevelopersolutions.com/2013/05/android-calendar-sync.html

4. http://www.androidviews.net/2013/04/extendedcalendarview/

5. http://abinashandroid.wordpress.com/2013/07/21/how-to-create-custom-calendar-in-android/

6. http://w2davids.wordpress.com/android-simple-calendar/

7. https://github.com/roomorama/Caldroid

8. https://github.com/flavienlaurent/datetimepicker

当您将访问以下内容时:

https://github.com/derekbrameyer/android-betterpickers

有关此项目的工作实施,请参见 sample/ 文件夹。

实施适当的Handler callbacks

public class MyActivity extends Activity implements     DatePickerDialogFragment.DatePickerDialogHandler {

      @Override
      public void onCreate(Bundle savedInstanceState) {
        // ...
      }

      @Override
      public void onDialogDateSet(int year, int monthOfYear, int dayOfMonth) {
        // Do something with your date!
      }
    }

使用其中一个 Builder 类来创建PickerDialog一个主题:

DatePickerBuilder dpb = new DatePickerBuilder()
        .setFragmentManager(getSupportFragmentManager())
        .setStyleResId(R.style.BetterPickersDialogFragment);
dpb.show();

还有另一个例子,你可以访问

https://github.com/roomorama/Caldroid

并使用如下

要将 caldroid 片段嵌入到您的活动中,请使用以下代码:

    CaldroidFragment caldroidFragment = new CaldroidFragment();
Bundle args = new Bundle();
Calendar cal = Calendar.getInstance();
args.putInt(CaldroidFragment.MONTH, cal.get(Calendar.MONTH) + 1);
args.putInt(CaldroidFragment.YEAR, cal.get(Calendar.YEAR));
caldroidFragment.setArguments(args);

FragmentTransaction t = getSupportFragmentManager().beginTransaction();
t.replace(R.id.calendar1, caldroidFragment);
t.commit();
于 2015-09-05T13:39:46.083 回答