hackiftekhar / IQActionSheetPickerView

ActionSheet with UIPickerView
MIT License
205 stars 76 forks source link

ActionSheetPicker Title - Cancel - Done Button Titles - ActionToolBar Color #9

Closed soner-yuksel closed 9 years ago

soner-yuksel commented 9 years ago

First of all thanks for easy to use awesome control.

However I really need an initialization method or a way to customize titles and colors of bar button items cancel and done. So I can use it in my localized application.

Something like this maybe ?

hackiftekhar commented 9 years ago

If you need to customize the action sheet picker, then how about adding color, font properties in IQActionSheetPicker. So the initializarion method remains short and simple and developer can the use properties to change the appearance after initialization. Could you do this on behalf of me and send me a pull request?

soner-yuksel commented 9 years ago

Sure I will do it, however getting frame of bar button item in order to calculate the width of the title bar button is tricky. Btw in your example code titling doesnt work at all. I will also correct it.

Cheers

hackiftekhar commented 9 years ago

Sure, and thanks for your contribution, make sure you have latest code before starting changes. I've done some major changes 2-3 weeks ago to support iOS8.

MikeJaoudi commented 9 years ago

It would be awesome if you could add this!

akring commented 9 years ago

I just created a pull request for this,check it later:)

hackiftekhar commented 9 years ago

Pull request merged!

burakkoray commented 8 years ago

Thanks for the great project do we have any option to changedone and cancel button text I could not found how to change ?

akring commented 8 years ago

Of course you can,In IQActionSheetPickerView.m:

//  Create a cancel button to show on keyboard to resign it. Adding a selector to resign it.
            UIBarButtonItem *cancelButton = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemCancel target:self action:@selector(pickerCancelClicked:)];
            [items addObject:cancelButton];
//  Create a done button to show on keyboard to resign it. Adding a selector to resign it.
            UIBarButtonItem *doneButton =[[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemDone target:self action:@selector(pickerDoneClicked:)];
            [items addObject:doneButton];

Just use the style you want

burakkoray commented 8 years ago

I mean can I change the button title done and cancel . Can I write finish instead of done

akring commented 8 years ago

Sure,remove the done buttonItem first:

//  Create a done button to show on keyboard to resign it. Adding a selector to resign it.
UIBarButtonItem *doneButton =[[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemDone target:self action:@selector(pickerDoneClicked:)];
[items addObject:doneButton];

Then create a new UIBarButtonItem via:

//  Create a finish button to show on keyboard to resign it. Adding a selector to resign it.
UIBarButtonItem *finishButton = [[UIBarButtonItem alloc] initWithTitle:@"Finish" style:UIBarButtonItemStylePlain target:self action:@selector(pickerDoneClicked:)];
 [items addObject:finishButton];

Currently we can just modify title by hardcoding,you can create a pull request to add this feature:)