gpt4 book ai didi

android - 自定义日历 View (回历)

转载 作者:塔克拉玛干 更新时间:2023-11-02 22:45:25 27 4
gpt4 key购买 nike

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

我需要这样的东西:

enter image description here

最佳答案

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

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

有关此项目的有效实现,请参阅示例/文件夹。

实现适当的处理程序回调:

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

并按如下方式使用

要在您的 Activity 中嵌入 caldroid fragment ,请使用以下代码:

    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();

关于android - 自定义日历 View (回历),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23128650/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com