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

查看:97
本文介绍了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在Simulator和设备上都会发生这种情况。
其他人是否也遇到同样的问题?

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处的otherButtonTitles中添加取消,然后指定
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天全站免登陆