2016-03-22 13 views
0

私は現在、CollectionViewControllerを持っています。セルをクリックすると、詳細ビ​​ューコントローラ(TableViewController)が表示されます。TableViewControllerはモーダルに表示されません

モーダルTableVCを表示するためのコード:物事は上記のコードで正常に動作している

UIStoryboard *storyboard = [UIStoryboard storyboardWithName:@"Main" bundle:nil]; 
UIViewController *detailVC = [storyboard instantiateViewControllerWithIdentifier:@"DetailTimetableViewController"]; 

[self presentViewController:detailVC animated:true completion:nil]; 

、テーブルビューコントローラをモーダルモードで表示され、スクロールが正常に動作しています。

しかし、私はをUIViewControllerAnimatedTransitioningカスタムを作成する、このチュートリアル(http://blog.matthewcheok.com/design-teardown-preview-expanding-cells/)を、その後、私は完全に正常に動作するようにチュートリアルからすべてを持っていました。表示TableVCため

コードモーダル(カスタムアニメーション付き):TableViewControllerが提示されている場合しかし、すべてがを除いて正常に動作している

UIStoryboard *storyboard = [UIStoryboard storyboardWithName:@"Main" bundle:nil]; 
UIViewController *detailVC = [storyboard instantiateViewControllerWithIdentifier:@"DetailTimetableViewController"]; 

ExpandingCellTransition *transition = [[ExpandingCellTransition alloc]init]; 
detailVC.transitioningDelegate = transition; 

[self presentViewController:detailVC animated:true completion:nil]; 

、それは下にスクロール可能にしない、とで制限されています特定の高さ。

私は同様の問題(TableViewControllerを下にスクロールできません)を検索しようとしましたが、ソリューションを適用しようとしましたが動作しませんでした。私はカスタムトランジェントデリゲートの問題の原因と考えています。

+0

あなたのテーブルビューcontを確認するストーリーボードのローラー制約 –

+0

テーブルビューコントローラーに制約を追加しようとしましたが、できませんでしたが、制約フォームは空白です。同じシナリオ(http://stackoverflow.com/questions/21182226/unable-to-use-autolayout-constraints-in-a-tableview)とにかくありがとう:D – Daryl

+0

これを試してみてくださいhttp://stackoverflow.com/questions/29804323/xcode-adding-constraints-to-uitableview-so-that-it-fits-all-screen-sizes –

答えて

0

追加し、この

// Obj-C 
self.automaticallyAdjustsScrollViewInsets = NO; 

// Swift 
self.automaticallyAdjustsScrollViewInsets = false 

希望がMainViewControllerviewDidLoad方法であなたに

+0

私のviewDidLoadで実装しようとしましたTableView Controllerを使用し、presentViewControllerメソッドの前にCollectionViewControllerで設定しようとしましたが、とにかくうまくいきませんでした。 – Daryl

0

を助けるかもしれない次のコードを試してみてください:YES = self.automaticallyAdjustsScrollViewInsets= NO

+0

両方のView Controllerであなたの提案を実装しようとしましたが、うまくいきませんでした。 – Daryl

0

セットtableviewProperty tableview.UITableViewAutomaticDimensionを

+0

答えを実装する方法がわかりませんが、検索した後、セルサイズの自動調整に関連していることがわかりましたが、テーブルビューの高さの問題によって問題が発生していると思います。 – Daryl

+0

セル内の自動レイアウトを使用し、回答が – Saood

0
use following code in cellForrowAtindexPath delegate method: 

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { 
    UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:<#@"reuseIdentifier"#> forIndexPath:indexPath]; 

    // Configure the cell... 

    return cell; 
} 
+0

に記載されているプロパティを設定しました。この問題は、セル内ではなく、テーブルビューの高さであると考えています。 – Daryl

関連する問題