我有 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.
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.");
}
}