objective-c – UIActionSheet在iPad上不显示取消按钮

objective-c – UIActionSheet在iPad上不显示取消按钮,第1张

概述我试图在UIActionSheet中显示取消按钮,但它不显示,是一个可以接受的行为?请指教。 UIActionSheet *actionSheet = [[UIActionSheet alloc] initWithTitle:@"Are you sure you want to clear the cache?" delegate:self 我试图在UIActionSheet中显示取消按钮,但它不显示,是一个可以接受的行为?请指教。

UIActionSheet *actionSheet = [[UIActionSheet alloc]          initWithTitle:@"Are you sure you want to clear the cache?"          delegate:self          cancelbuttonTitle:@"No"          destructivebuttonTitle:@"Yes"          otherbuttonTitles:nil];[actionSheet showInVIEw:self.vIEw];  [actionSheet release];
解决方法 iPad有一些关于 *** 作表和取消按钮的特殊规则,具体取决于您从哪里显示它:

You can present an action sheet from a toolbar,tab bar,button bar item,or from a vIEw. This class takes the starting vIEw and current platform into account when determining how to present the action sheet. For applications running on iPhone and iPod touch devices,the action sheet typically slIDes up from the bottom of the window that owns the vIEw. For applications running on iPad devices,the action sheet is typically displayed in a popover that is anchored to the starting vIEw in an appropriate way. Taps outsIDe of the popover automatically dismiss the action sheet,as do taps within any custom buttons. You can also dismiss it programmatically.

When presenting an action sheet on an iPad,there are times when you should not include a cancel button. If you are presenting just the action sheet,the system displays the action sheet insIDe a popover without using an animation. Because taps outsIDe the popover dismiss the action sheet without selecting an item,this results in a default way to cancel the sheet. Including a cancel button would therefore only cause confusion. However,if you have an existing popover and are displaying an action sheet on top of other content using an animation,a cancel button is still appropriate. For more information see iPad Human Interface GuIDelines.

这里有一个链接,更多的解释:http://crazyviraj.blogspot.com/2010/05/showing-cancel-button-in.html

总结

以上是内存溢出为你收集整理的objective-c – UIActionSheet在iPad上不显示取消按钮全部内容,希望文章能够帮你解决objective-c – UIActionSheet在iPad上不显示取消按钮所遇到的程序开发问题。

如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。

欢迎分享,转载请注明来源:内存溢出

原文地址: https://outofmemory.cn/web/1087435.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2022-05-27
下一篇 2022-05-27

发表评论

登录后才能评论

评论列表(0条)

保存