当前位置:网站首页>calendarview日历视图组件的功能和用法
calendarview日历视图组件的功能和用法
2022-07-07 15:40:00 【XLMN】
calendarview日历视图组件的功能和用法
calendarview可用于显示和选择日期。用户可以进行选择日期,或者通过触摸滚动日历,也可通过setondatechangelistener()放法进行监控该日期改变
<?xml version="1.0" encoding="utf-8"?>
设置周风格线颜色
public class MainActivity extends Activity {
CalendarView cv;
@Override
protected void onCreate(@Nullable Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.calendarview);
cv=findViewById(R.id.calendarview);
//为calendarview添加事件监听
cv.setOnDateChangeListener(new CalendarView.OnDateChangeListener() {
@Override
public void onSelectedDayChange(@NonNull CalendarView view, int year, int month, int dayOfMonth) {
//使用total显示用户选择的日期
Toast.makeText(MainActivity.this,"你相信一句话吗,做好准备都的人一定会得到一颗糖 "+year+"年"+(month+1)+"月"+dayOfMonth+"日,加油,乾坤未定,你就是黑马",Toast.LENGTH_LONG).show();
}
});
}
}
边栏推荐
猜你喜欢
随机推荐
DevOps 的运营和商业利益指南
Flask搭建api服务-SQL配置文件
L1-023 输出GPLT(Lua)
如何在软件研发阶段落地安全实践
Repair method of firewall system crash and file loss, material cost 0 yuan
LeetCode 403. Frog crossing the river daily
On Apache Doris Fe processing query SQL source code analysis
[video / audio data processing] Shanghai daoning brings you elecard download, trial and tutorial
mysql使用笔记一
自定义View必备知识,Android研发岗必问30+道高级面试题
Sator launched Web3 game "satorspace" and launched hoobi
第1章CRM核心业务介绍
2021-06-28
Sator推出Web3游戏“Satorspace” ,并上线Huobi
【网络攻防原理与技术】第4章:网络扫描技术
赋能智慧电力建设 | 麒麟信安高可用集群管理系统,保障用户关键业务连续性
数值 - number(Lua)
麒麟信安操作系统衍生产品解决方案 | 存储多路径管理系统,有效提高数据传输可靠性
本周小贴士131:特殊成员函数和`= default`
How to mount the original data disk without damage after the reinstallation of proxmox ve?




![[Seaborn] combination chart: facetgrid, jointgrid, pairgrid](/img/89/a7cf40fb3a7622cb78ea1b92ffd2fb.png)




