私はこのような階層のViewController(1)を持っています
ViewController
- UIView
-- UITableView (height 80% of it's superview)
-- UIButton ( height 20% of it's superview, 80% offset y)
UIButtonを押すと、新しいViewControllerがプッシュされます。今まではすべて問題ありませんでしたが、アニメーションの瞬間に、ビュー全体に収まるようにUIButtonのサイズが変更されていることがわかります。今戻った後、私はビュー全体に私のボタンがあります。
この問題が発生する原因は何ですか?
1.1。
UIPopOverController
- UINavigationController
-- UIViewController
編集1:
- (void)viewDidAppear:(BOOL)animated
{
// ...
_storeButton = [[UIButton alloc] initWithFrame:frame];
_storeButton.adjustsImageWhenHighlighted = NO;
_storeButton.backgroundColor = [UIColor colorWithHexString:(_productData.count > 0) ? @"0x8BC53F" : @"0xA4A4A4" ];
[_storeButton addTarget:self action:@selector(storeButtonTouched:) forControlEvents:UIControlEventTouchUpInside];
// ...
}
#pragma mark - Store request.
- (void)storeButtonTouched:(id)sender
{
DLog(@"_storeButton: %@", _storeButton);
if ( _productData != nil && _productData.count > 0) {
_productData = [NSArray arrayWithArray:_iapManager.productData];
TTIAPTableViewController *iapVC = [[TTIAPTableViewController alloc] initWithStyle:UITableViewStylePlain];
iapVC.entries = _productData;
iapVC.contentSizeForViewInPopover = self.view.frame.size;
[self.navigationController pushViewController:iapVC animated:YES];
[iapVC release];
} else {
DLog(@"No products available.");
}
}