繁体   English   中英

如果调出UIActionSheet,如何使其中一个选项适合新视图?

[英]If I bring up a UIActionSheet, how do I make one of the options segue to a new view?

我真的不知道该怎么做。 我创建了UIActionSheet ,当我点击一个按钮时会出现它,但是我希望在为该应用选择了某个选项以将其选择到新的视图控制器时出现。

您在UIActionSheetDelegate方法中调用(当用户点击按钮时) [self performSegueWithIdentifyer:@"segue_id"];

使用UIActionSheet Delegate方法( – actionSheet:clickedButtonAtIndex:)

#pragma mark - UIActionSheet Delegate Methods

- (void)actionSheet:(UIActionSheet *)actionSheet clickedButtonAtIndex:(NSInteger)buttonIndex
{
    if(buttonIndex == 0)
    {
        // code for Button 1 
    }
    if(buttonIndex == 1)
    {
       // code for Button 2
    }
}

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM