iOS custom selector Actionsheetpicker Improved version

Source: Internet
Author: User

The biggest problem with iOS comes with Uidatapicker and Uidatepicker is that they don't have both the OK and Cancel buttons, and Actionsheetpicker is the open source package for the above two selectors. But this east also has some small problem, is the content that does not have the Chinese to choose the device.

The original Actionsheetpicker run like this:

After the improvement, this looks like this.

Click here to download, there is a problem can be deducted 359709421 discussion.

To supplement a bug fix, in iOS7 and above, the selector data part is transparent, very unattractive,

Add a line to the Showactionsheetpicker method of ABSTRACTACTIONSHEETPICKER.M

Masterview.backgroundcolor=[uicolor Whitecolor];

The problem can be resolved.

Java code
  1. -(void) Showactionsheetpicker {
  2. UIView *masterview = [[UIView alloc] Initwithframe:cgrectmake (0, 0, Self.viewSize.width, 260)];
  3. Uitoolbar *pickertoolbar = [self createPickerToolbarWithTitle:self.title];
  4. [Pickertoolbar setbarstyle:uibarstyleblacktranslucent];
  5. [Masterview Addsubview:pickertoolbar];
  6. Self.pickerview = [self configuredpickerview];
  7. Nsassert (_pickerview! = NULL, @"Picker view failed to instantiate, perhaps you have invalid component data.");
  8. [Masterview Addsubview:_pickerview];
  9. Masterview.backgroundcolor=[uicolor Whitecolor];
  10. [Self presentpickerforview:masterview];
  11. }
-(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 shop, please have a visit to visit http://mrs-x.taobao.com/

    • Size: 256.1 KB
    • Size: 221.6 KB
    • Timcinel-actionsheetpicker-4d01f72.zip

iOS custom selector Actionsheetpicker improved

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.