UIActionSheet 未在 iOS 7 GM 的最后一项上显示分隔符 [英] UIActionSheet is not showing separator on the last item on iOS 7 GM

查看:16
本文介绍了UIActionSheet 未在 iOS 7 GM 的最后一项上显示分隔符的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这可能是 iOS7 上的一个错误.但是最后一个按钮没有和前一个分开

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

从图片中可以看出.这发生在模拟器和使用 iOS7 GM 的设备上.其他人有同样的问题吗?

As you can see from the image. This happens on both Simulator and device using iOS7 GM. Does everyone else has the same problem?

UIActionSheet *actionSheet = [[UIActionSheet alloc]
               initWithTitle:@"Title"
               delegate:self
               cancelButtonTitle:nil
               destructiveButtonTitle:nil
               otherButtonTitles:@"First", @"Second", @"Third", @"Fourth", nil];
[actionSheet showInView:self.view];

如您所见,代码非常简单.关于如何解决问题的任何想法?或者我可以使用一些第三方库来代替 UIActionSheet ?

As you can see the code is quite simple. Any idea on how to fix the problem? Or some third party library I can use instead of UIActionSheet ?

推荐答案

我认为 ActionSheet 需要一个取消按钮.所以你可以添加取消按钮标题.

I think ActionSheet requires a cancel button.So you can add the cancel button title.

另一种方式是:指定actionSheet的cancelButtonIndex.

Another way is: Specify actionSheet's cancelButtonIndex.

例如,在您的情况下,您可以在其他按钮标题中的索引 4 处添加取消",然后指定actionSheet.cancelButtonIndex = 4.

For example,in your case, you can add a "Cancel" in otherButtonTitles at index 4 and then specifiy actionSheet.cancelButtonIndex = 4.

这篇关于UIActionSheet 未在 iOS 7 GM 的最后一项上显示分隔符的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆