Top Custom tabs bar displaying today and 1 week dates

安稳与你 提交于 2019-12-13 05:34:54

问题


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

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.


回答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);


来源:https://stackoverflow.com/questions/48298252/top-custom-tabs-bar-displaying-today-and-1-week-dates

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!