显示今天和 1 周日期的顶部自定义标签栏 [英] Top Custom tabs bar displaying today and 1 week dates

查看:46
本文介绍了显示今天和 1 周日期的顶部自定义标签栏的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

iOS Objective C 的初学者,我需要一些帮助来创建如图所示的自定义选项卡.

A beginner in iOS Objective C, I need to some help to create a custom tab as shown in the pic.

自定义标签将显示今天加上 6 天的日期.然后当用户点击日期时,它会调用一个 uRL.如果可能的话,我需要一些指示.非常感谢所有帮助,非常感谢.

The custom tab will show today's plus 6 days date. Then when user click on the dates, it will call a uRL. I need some pointers if possible. All help is highly appreciated, thank you very much.

推荐答案

您可以使用一些第三方分段控件.对于 Objective-C,可以是 thisthis,然后您从当前日期获得 6 个下一个日期,例如此代码将 1 天添加到当前日期等:

You could use some third-party segmented controls. For Objective-C is could be this or this, then you get 6 next dates from current date, for example this code adds 1 day to current date and etc.:

NSDateComponents *dayComponent = [[NSDateComponents alloc] init];
dayComponent.day = 1;

NSCalendar *theCalendar = [NSCalendar currentCalendar];
NSDate *nextDate = [theCalendar dateByAddingComponents:dayComponent toDate:[NSDate date] options:0];

NSLog(@"nextDate: %@ ...", nextDate);

这篇关于显示今天和 1 周日期的顶部自定义标签栏的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆