簡體   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