1

画面の右側にviewControllerを表示するためにJASidePanelsを使用しています。コントローラは、JASidePanelController サブクラスから次の方法でメイン ストーリーボードからロードされます。

-(void)awakeFromNib{

    UIStoryboard *mainStoryboard = [UIStoryboard storyboardWithName:@"Main" bundle:[NSBundle mainBundle]];

    TRMPracticeViewController *practiceVC = [mainStoryboard instantiateViewControllerWithIdentifier:@"Practice"];
    TRMPracticeSetupViewController *practiceSetup = [mainStoryboard instantiateViewControllerWithIdentifier:@"PracticeSetupVC"];

    [self setCenterPanel:practiceVC];
    [self setRightPanel:practiceSetup];
    [self setRightFixedWidth:practiceVC.view.frame.size.width/3.0f];

}

TRMPracticeSetupViewController には、ストーリーボードに 200px x 320 px の固定フレームがあり、コントローラーが読み込まれて横に追加されたら、幅を維持したいと思います (または、少なくとも画面のサイズに比例する幅)。

ただし、VC がロードされて追加されると、そのフレームは中央のビュー コントローラーと同じに設定され、もちろん画面のサイズになります。そのため、右側の vc 内のビューは、コンテナーの境界にマージンを固定する自動レイアウト制約により、中央の vc の下に入ります。

右パネルの境界幅を 200px などに修正するにはどうすればよいですか?

4

1 に答える 1