我已经下载了一个很好的示例代码UAModalPanel。我已经在我的项目中实现了它,如果我们点击段控件的第一个索引,它将打开 UAModalPanel。我可以成功地实现这一点。
但是,如果我们在段控制中选择第二个或第三个索引,我需要关闭 UAModalPanel 我该如何实现这一点。如果有人知道指导我吗?
如果我们点击下面的段控件将被调用
-(void)navBarSegmentCntrl_tapped
{
if(navBarSegmentCntrl.selectedSegmentIndex==0)
{
UAExampleModalPanel *modalPanel = [[UAExampleModalPanel alloc] initWithFrame:self.view.bounds title:@"dfg" ];
[self.view addSubview:modalPanel];
// Show the panel from the center of the screen
[modalPanel showFromPoint:self.view.center];
}
else if(navBarSegmentCntrl.selectedSegmentIndex==1)
{
[UAmodal hide]; //UAmodal allocated in view didload//
imagePickerController = [[UIImagePickerController alloc] init];
imagePickerController.delegate = self;
imagePickerController.sourceType =
UIImagePickerControllerSourceTypePhotoLibrary;
[self presentModalViewController:imagePickerController animated:YES];
}
}