私は最近、私のアプリで非常に奇妙な動作に気づいた。ビューのフレームを設定するとき、原点が入力したものの2倍であるかのように振る舞います。他のビューは影響を受けず、影響を受けるビューの幅と高さもありません。誰かがこれの前にこのような何かを見たり聞いたり?iPadピクセル倍増ですか?
EDIT:
これは何とか問題を引き起こしているように見える私のカスタムのinitメソッド内のコードですが、私は、なぜ離れて選ぶことができません。
if ((self = [super initWithFrame:frame])) {
self.backgroundColor = [UIColor clearColor];
self.controller = aController;
self.backgroundColor = [UIColor colorWithRed:0.0 green:0.0 blue:0.0 alpha:0.0];
UIView *centerView = [[UIView alloc] initWithFrame:frame];
[self addSubview:centerView];
UIToolbar *navBar = [[UIToolbar alloc] initWithFrame:CGRectMake(0, 0, frame.size.width, 44)];
NSMutableArray *array = [[NSMutableArray alloc] init];
UIBarButtonItem *item = item = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemStop target:self action:@selector(closeClicked:)];
[array addObject:item];
item = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemFlexibleSpace target:nil action:nil];
[array addObject:item];
item = [[UIBarButtonItem alloc] initWithTitle:@"Title" style:UIBarButtonItemStylePlain target:nil action:nil];
[array addObject:item];
item = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemFlexibleSpace target:nil action:nil];
[array addObject:item];
item = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemAction target:nil action:nil];
[array addObject:item];
[navBar setItems:array];
[centerView addSubview:navBar];
centerView.clipsToBounds = YES;
centerView.opaque = TRUE;
centerView.alpha = 1.0;
centerView.backgroundColor = [UIColor whiteColor];
[self addSubview:centerView];
}
return self;
}
? –
いくつかのコードを掲示した後、私の答えを更新しました。 –