私は内部にscrollViewが組み込まれたView Controllerを持っています。このスクロールビューでは、XIBファイルビューである4つのビューが追加されています。 XIBファイルのサイズは、iphone5サイジングのように見えますが、「推測」です。ロードされると、画面のサイズに自動リサイズされず、iphone5サイズに留まります。XIBファイルのサイズを画面サイズに合わせて自動調整する
XIBファイルを読み込んでいる画面と同じサイズにするにはどうすればよいですか?
EDIT:
私はまた、このようなコードをnibファイルのサイズを変更しようとしている:
// 1) Create the three views used in the swipe container view
let AVc :AViewController = AViewController(nibName: "AViewController", bundle: nil);
let BVc :BViewController = BViewController(nibName: "BViewController", bundle: nil);
let CVc :CViewController = CViewController(nibName: "CViewController", bundle: nil);
let DVc :DViewController = DViewController(nibName: "DViewController", bundle: nil);
AVc.view.frame = CGRectMake(0 , 0, self.view.frame.width, self.view.frame.height)
BVc.view.frame = CGRectMake(0 , 0, self.view.frame.width, self.view.frame.height)
CVc.view.frame = CGRectMake(0 , 0, self.view.frame.width, self.view.frame.height)
DVc.view.frame = CGRectMake(0 , 0, self.view.frame.width, self.view.frame.height)
// 2) Add in each view to the container view hierarchy
// Add them in opposite order since the view hieracrhy is a stack
self.addChildViewController(DVc);
self.scrollView!.addSubview(DVc.view);
DVc.didMoveToParentViewController(self);
self.addChildViewController(CVc);
self.scrollView!.addSubview(CVc.view);
CVc.didMoveToParentViewController(self);
self.addChildViewController(BVc);
self.scrollView!.addSubview(BVc.view);
BVc.didMoveToParentViewController(self);
self.addChildViewController(AVc);
self.scrollView!.addSubview(AVc.view);
AVc.didMoveToParentViewController(self);
これはまだ影響を与えており、それが間違ったサイズをロードします。
おそらくautolayout? –
私はオートレイアウトを使用していません –