0

In the following method

- (void)willPresentActionSheet:(UIActionSheet *)actionSheet{

I have set:

[button setBackgroundColor:[UIColor redColor]];

This is for one button. But here is what I get:

enter image description here

What I want to know is how to set the color only on button without the side gaps ?

Any guidance or help is appreciated.

Thanks.

Dhrumil
  • 3,221
  • 6
  • 21
  • 34
1110
  • 7,829
  • 55
  • 176
  • 334

2 Answers2

0

If you want to change the title color use the below code.

for (UIView *view in actionSheet.subviews) {
    if ([view isKindOfClass:[UIButton class]]) {
        UIButton *button = (UIButton *)view;
        [button setTitleColor:[UIColor redColor] forState:UIControlStateNormal];

    }
}
Nikhila Mohan
  • 2,000
  • 2
  • 15
  • 19
0

I also need the custom UIAcionSheet but default actionsheet doesn't support the customization functionality so i used the other customer controller UICustomActionSheet and got the expected result like

enter image description here

Retro
  • 3,985
  • 2
  • 17
  • 41