UIActionSheet is not showing separator on the last item on iOS 7 GM

后端 未结 8 444
暗喜
暗喜 2020-12-03 04:31

It could be probably a bug on iOS7. But the last button is not separated from the previous one\"UIActionSheet

8条回答
  •  有刺的猬
    2020-12-03 05:05

        - (void)willPresentActionSheet:(UIActionSheet *)actionSheet {
        if ([UIDevice currentDevice].systemVersion.floatValue < 8.0f) {
            UIView *separator = [[UIView alloc] initWithFrame:CGRectMake(8, 88, actionSheet.frame.size.width - 16, 0.5)];
            separator.backgroundColor = [UIColor colorWithRed:219.0f/255 green:219.0f/255 blue:223.0f/255 alpha:1];
            [actionSheet addSubview:separator];
        }
    }
    

    Every button has height 44. My actionSheet doesn't have title. And I wanted to add separator between second and third buttons. That's why I use number 88.

提交回复
热议问题