The present invention provides a calendar implementation method that measures the height of the View at the same time in January, and calculates the difference between the height values obtained by the first measurement and the height values obtained by the other 1 measurements by the rest of the n. In turn, detect whether the difference between N and 1 is larger than the preset difference threshold. When the difference is greater than the preset difference threshold, the detection is stopped and the measurement height corresponding to the difference is obtained. According to the height measured by the first measurement and the height corresponding to the difference, the ViewPager height of the month is determined. The month is displayed in calendar APP according to ViewPager height and View in that month. The calendar implementation method provided by the invention can accurately extract the ViewPager height per January, and then change the height of the month in calendar APP. There is animation process in the month switching process, which makes the month switching smoothly and smoothly.
【技术实现步骤摘要】
一种日历实现方法
本专利技术涉及通信
,尤其涉及一种日历实现方法。
技术介绍
随着手机、ipad和电脑等移动终端设备的普及以及应用的推广,越来越多的用户依赖于移动终端设备。移动终端设备大多设置有日历这一应用,以便于用户查看当前或历年日期。目前,可用的日历APP(Application,中文全称:应用软件)多种多样,如万年历、365日历以及中华万年历等。由于每个月份的天数不同,因而每个月份所占行数不同,继而呈现为不同的显示形式。附图1示出了一种常见的日历显示界面。由图1可见,各月份分别占据5行,每个月份的总高度、总行数不变。为实现前后月份的总高度、总行数不变,前后两个月份需要通过补位或合位的形式满足总高度,如1月份的合位,2月份的补位。当采用图1所示日历呈现形式时,日历内容较为复杂,不易直观得出日期与星期的对应关系,影响用户的使用。附图2示出了另一种常见的日历显示界面。由图2可见,每个月份的总高度仍然不变,但行数发生变化。由于行数发生变化,因而前后两个月份中的字体大小不一致,影响用户对日历的视觉体验。综上,需要一种日历实现方法,以满足用户对日历显示界面的视觉需 ...
【技术保护点】
一种日历实现方法,其特征在于,所述方法包括:对同一月份的View高度测量n次;依次分别计算第一次测量得到的高度值与其余n‑1次测量得到的高度值之间的差值;依次检测所述差值是否大于预设差值阈值;当检测到所述差值大于所述预设差值阈值时,停止检测,获取所述差值对应的高度值;根据所述第一次测量得到的高度值和所述差值对应的高度值确定所述月份的ViewPager高度;根据所述月份的View和所述ViewPager高度呈现所述月份。
【技术特征摘要】
1.一种日历实现方法,其特征在于,所述方法包括:对同一月份的View高度测量n次;依次分别计算第一次测量得到的高度值与其余n-1次测量得到的高度值之间的差值;依次检测所述差值是否大于预设差值阈值;当检测到所述差值大于所述预设差值阈值时,停止检测,获取所述差值对应的高度值;根据所述第一次测量得到的高度值和所述差值对应的高度值确定所述月份的ViewPager高度;根据所述月份的View和所述ViewPager高度呈现所述月份。2.根据权利要求1所述的日历实现方法,其特征在于,所述测量次数n≥5。3.根据权利要求1所述的日历实现方法,其特征在于,所述预设差值阈值为50。4.根据权利要求1所述的日历实...
【专利技术属性】
技术研发人员:陈剑波,汪亮,
申请(专利权)人:成都路行通信息技术有限公司,
类型:发明
国别省市:四川,51
还没有人留言评论。发表了对其他浏览者有用的留言会获得科技券。