自定义UIViewControllerContextTransitioning和黑屏

时间:2015-08-23 20:08:40

标签: ios objective-c uitableview cocoa-touch core-animation

我有一个UITableViewController,在我的UITableViewCell中我有一个imageView当用户点击它时,我使用我自己的自定义UIViewControllerContextTransitioning以模拟方式对其进行缩放效果,它就像一个魅力的问题是当动画完成,我打电话给

[transitionContext completeTransition:YES];

现在我的Modal UIViewController背后的UITableView被从视图层次结构中移除,所以我后面有一个黑屏

 [containerView addSubview:toViewController.view];
 [UIView animateWithDuration:duration delay:0.0 usingSpringWithDamping:damping initialSpringVelocity:1.0 / damping options:0 animations:^{
    // blablabla animation stuff
 } completion:^(BOOL finished) {
   [transitionContext completeTransition:YES];// this line makes my UITableView removed form the view hierarchy 
 }];

这是我到目前为止所尝试的内容:

在完成块中添加UITableView

  [[UIApplication sharedApplication ].keyWindow insertSubview:fromViewController.view belowSubview:containerView];

但这仅适用于iOS8 ......

任何想法如何解决这个问题?谢谢!!

1 个答案:

答案 0 :(得分:0)

尝试将展示视图控制器的UIModalPresentationCustom设置为<?php $a = $_POST['findSchool']; //1. Enter database credentials $servername = "****"; $username = "****"; $password = "****"; $dbname = "****"; $flag = 0; // 2. Create connection $conn = new mysqli($servername, $username, $password, $dbname); echo '<form id="myNewForm" name="myNewForm" class="form" method="post" action="">'; echo '<table class="table table-bordered">'; echo '<tr scope="col" > <th align="center">SchoolName</th> <th align="center">Details</th> </tr>'; $sql = "SELECT schName FROM schoolinformation WHERE schName LIKE '%$a%'"; echo $sql; $i = 0; $result = mysqli_query($conn, $sql); while($rowval = mysqli_fetch_array($result)) { $schName= $rowval['schName']; echo '<tr scope="col"><td align="center">'.$rowval['schName'].'</td> <td align="center"><input type="submit" id="shwData" name="shwData" class="btn" value="Show"/></td>'; } echo '</table>'; echo '</form>'; if($schName == '') { echo "Entry not found"; $flag = 1; } else { //echo $schName; $flag = 0; } ?> <?php if (isset($_POST['shwData'])) { echo "this is it"; } ?>