Alex Rivera | Logout

Custom iOS UIDatepicker using UIAppearance

Asked 2012-06-01T05:03:16.557
13

UNIQLO's new alarm app has a custom UIDatePicker:

custom

And I want to create my own custom UIDatePicker.

I tried to change the appearance of the DatePicker, but looking for UI_APPEARANCE_SELECTOR in the UIDatePicker returns nothing.

Meaning that its not possible to change any values, as per the docs:

To support appearance customization, a class must conform to the UIAppearanceContainer protocol and relevant accessor methods must be marked with UI_APPEARANCE_SELECTOR.

How can change my UIDatePicker's appearance?

Edit
Report

1 Answer

-1

A combination of 2 UITableViews is the way to go.

UITableView is a subview of UIScrollView, so it handles the following event

-(void)scrollViewDidEndDragging:(UIScrollView *)scrollView willDecelerate:(BOOL)decelerate
{

}

and on getting the position, just scroll the table to the center using the following method

[myTableView scrollToRowAtIndexPath:indexPath atScrollPosition:UITableViewScrollPositionMiddle animated:YES];

Hope this helps.

answered 2012-07-09T14:44:41.543

Your Answer