当前位置:网站首页>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();
}
});
}
}
边栏推荐
- Problems encountered in Jenkins' release of H5 developed by uniapp
- Mrs offline data analysis: process OBS data through Flink job
- 大笨钟(Lua)
- How to implement safety practice in software development stage
- Sator launched Web3 game "satorspace" and launched hoobi
- LeetCode 403. Frog crossing the river daily
- Establishment of solid development environment
- Sator推出Web3游戏“Satorspace” ,并上线Huobi
- [Fantan] how to design a test platform?
- MySQL implements the query of merging two fields into one field
猜你喜欢

本周小贴士#136:无序容器

Sator launched Web3 game "satorspace" and launched hoobi

责任链模式 - Unity

第3章业务功能开发(安全退出)

Sator launched Web3 game "satorspace" and launched hoobi

A tour of grpc:03 - proto serialization / deserialization

Shallow understanding Net core routing

PLC: automatically correct the data set noise, wash the data set | ICLR 2021 spotlight

【信息安全法律法規】複習篇

【TPM2.0原理及应用指南】 1-3章
随机推荐
[video / audio data processing] Shanghai daoning brings you elecard download, trial and tutorial
【视频/音频数据处理】上海道宁为您带来Elecard下载、试用、教程
第3章业务功能开发(用户登录)
第二十四届中国科协湖南组委会调研课题组一行莅临麒麟信安调研考察
百度地图自定义样式向右拖拽导致全球地图经度0度无法正常显示
Skimage learning (2) -- RGB to grayscale, RGB to HSV, histogram matching
服务器彻底坏了,无法修复,如何利用备份无损恢复成虚拟机?
大笨钟(Lua)
本周小贴士#136:无序容器
第3章业务功能开发(用户访问项目)
LeetCode1051(C#)
简单的loading动画
mysql使用笔记一
Enum + Validation 的个人最佳实践 demo 分享
centos7安装mysql笔记
Rpcms method of obtaining articles under the specified classification
AI来搞财富分配比人更公平?来自DeepMind的多人博弈游戏研究
如何在软件研发阶段落地安全实践
字符串 - string(Lua)
LeetCode 497(C#)