【问题标题】:how to set tag for actionsheet?如何为操作表设置标签?
【发布时间】:2013-07-02 13:51:59
【问题描述】:

我正在尝试设置一个标签以在我的 iOS 应用程序中启用多个操作表,但我应该在哪里声明它以及如何声明它?

[actionSheet setTag:kActionSheet1];

这在我输入的 .m 中,但需要声明

【问题讨论】:

  • 标签是一个整数值。你定义了int kActionSheet1 = 1; 吗?

标签: ios objective-c tags


【解决方案1】:
UIActionSheet *asheet = [[UIActionSheet alloc] init];
[asheet setTag:11];
[asheet showInView:self.view]; 

这里有一些教程。

iOS Quick Tip: Create a Dynamic Action Sheet

UIActionSheet and UIActionSheetDelegate

【讨论】:

  • 您不应该设置操作表的框架,最好最后调用showInView:
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多