Ios custom selector ActionSheetPicker available version, iospicker

Source: Internet
Author: User

Ios custom selector ActionSheetPicker available version, iospicker

The biggest problem with UIDataPicker and UIDatePicker in ios is that there are no buttons for confirmation and cancellation, while ActionSheetPicker is an open-source encapsulation of the preceding two selectors. However, there is also a small problem with this stuff, that is, there is no Chinese selector content.

The original ActionSheetPicker runs like this:

 

This is what it looks like after improvement

 

Click here to download. If you have any questions, you can deduct 359709421 for discussion.

 

Add a defect fix. In ios7 and later versions, the selector data is transparent and not beautiful,

Add a line to the showActionSheetPicker method of AbstractActionSheetPicker. m.

MasterView. backgroundColor = [UIColor whiteColor];

This problem can be solved.

 

Java code
  • -(Void) showActionSheetPicker {
  • UIView * masterView = [[UIView alloc] initWithFrame: CGRectMake (0, 0, self. viewSize. width, 260)];
  • UIToolbar * pickerToolbar = [self createPickerToolbarWithTitle: self. title];
  • [PickerToolbar setBarStyle: UIBarStyleBlackTranslucent];
  • [MasterView addSubview: pickerToolbar];
  • Self. pickerView = [self configuredPickerView];
  • NSAssert (_ pickerView! = NULL, @ "Picker view failed to instantiate, perhaps you have invalid component data .");
  • [MasterView addSubview: _ pickerView];
  • MasterView. backgroundColor = [UIColor whiteColor];
  • [Self presentPickerForView: masterView];
  • }
  • - (void)showActionSheetPicker {    UIView *masterView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, self.viewSize.width, 260)];        UIToolbar *pickerToolbar = [self createPickerToolbarWithTitle:self.title];    [pickerToolbar setBarStyle:UIBarStyleBlackTranslucent];    [masterView addSubview:pickerToolbar];    self.pickerView = [self configuredPickerView];    NSAssert(_pickerView != NULL, @"Picker view failed to instantiate, perhaps you have invalid component data.");    [masterView addSubview:_pickerView];    masterView.backgroundColor=[UIColor whiteColor];    [self presentPickerForView:masterView];}

     

    My online shop, please visit http://mrs-x.taobao.com/

    • The size is 256.1 KB.
    • The size is 221.6 KB.
    • TimCinel-ActionSheetPicker-4d01f72.zip



    Related Article

    Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.