わかりました、私はあなたのコードに何か奇妙なことに気づきました。
幅のサイズを aRect の x 位置の原点に追加する理由は何ですか? aRect.origin.x += aRect.size.width;
これを右上隅にしたいと思っています....
.m ファイルのコードのコメントを外して、次のようにすることができます。
// Override to allow orientations other than the default portrait orientation.
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {
Return YES; // for supported orientations
//otherwise return (interfaceOrientation == UIInterfaceOrientationLandscape); if you want only landscape mode.
}
または、サブビューをレイアウトしたい場合に私があなたの状況で行うことは、didRotateFromIntferfaceOrientation: を使用することです。
(void) didRotateFromInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
{
[self layoutSubviews];
}
また、layoutSubviews
- (void)layoutSubviews
{
NSLog(@"layoutSubviews called");
...recalc rects etc based on the new self.view.bounds...
}
そのように動作します。
PK