0

I know I can access a individual button on a actionSheet using a for loop to access the particular button in the action sheet I want, but the thing is, how would I make a green button? I know each button acts almost identically to a UIButton so how should I go upon making one of my buttons in the action sheet green?

I just need some tips or help with this as it is the last part of my app that isn't done!

Thanks!

SimplyKiwi
  • 12,376
  • 22
  • 105
  • 191

1 Answers1

1

When I have needed customizations for UIActionSheets, sometimes I find methods to make it happen simply, but more often I end up having to set up a custom view on way or another. I've added all manners of custom controls with:

[sheet addSubview: myCustomActionSheetController.view];

You might need to set the size as well.

Peter DeWeese
  • 18,141
  • 8
  • 79
  • 101
  • Alright so if I end up using a custom actionsheet, how would I make a button green? Would I have to have my own green image? – SimplyKiwi Sep 18 '11 at 02:45
  • I used the discussion in the following link, which suggests a UISegmentedControl. http://stackoverflow.com/questions/372731/how-can-i-set-a-button-background-color-on-iphone – Peter DeWeese Sep 18 '11 at 02:55
  • So there is no way to do this without using a custom action sheet? I don't really want to use a segmented control :[ – SimplyKiwi Sep 18 '11 at 04:30
  • No documented way, and undocumented ways(which I don't happen to know for this case) might get your app rejected. The segmented control ends up looking like a standard button when it only has one segment. If you really have to make it look like an actionsheet button, you can use a UIButton with a custom background as recommended in that same discussion. UIActionSheets were designed for a very simple and constrained purpose, leaving lots of work for customization. – Peter DeWeese Sep 18 '11 at 04:38
  • Dang I wish there was an easier way, I would use a custom action sheet but thats means I would have to recode a lot of things! – SimplyKiwi Sep 18 '11 at 05:46