您的位置:首页 > 移动开发 > Swift

ios开发swift中actionsheet的用法 从下面弹出

2014-12-28 14:56 176 查看
//注册账号的button
- (IBAction)goRegisterVC:(id)sender {
   
    //用一个actionsheet
    UIActionSheet *actionSheet = [[UIActionSheet alloc] initWithTitle:kNetPath_Code_Base delegate:self cancelButtonTitle:@"取消" destructiveButtonTitle:nil otherButtonTitles:@"去Safari中注册", nil];
    //actionsheet 从上向下 ID 0 慢慢增大
   
    [actionSheet showInView:kKeyWindow];
//    DebugLog(@"goRegisterVC");
//    RegisterViewController *vc = [[RegisterViewController alloc] init];
//    [self.navigationController pushViewController:vc animated:YES];
}

#pragma mark UIActionSheetDelegate M
- (void)actionSheet:(UIActionSheet *)actionSheet didDismissWithButtonIndex:(NSInteger)buttonIndex{
    if (buttonIndex == 0) {
        [[UIApplication sharedApplication] openURL:[NSURL URLWithString:kNetPath_Code_Base]];
    }
}
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: