开发者

Mangled View Frame with Split View Controller

开发者 https://www.devze.com 2023-03-12 20:18 出处:网络
In my application which features a split view controller I have a loading view. My Root View Controller is a subclass of UITableViewController; while loading data I save self.view and transition it ou

In my application which features a split view controller I have a loading view. My Root View Controller is a subclass of UITableViewController; while loading data I save self.view and transition it out with the loading view:

- (void)loadingWill开发者_Python百科Begin {
    self.cachedView = self.view;
    self.progressBar.progress = 0.0;
    [UIView transitionFromView:self.view toView:self.loadingView duration:1.0 options: UIViewAnimationOptionTransitionCurlDown completion:NULL];
    self.view = self.loadingView;
}

- (void)loadingDidFinish {
    [UIView transitionFromView:self.loadingView toView:self.cachedView duration:1.0 options:UIViewAnimationOptionTransitionCurlUp completion:NULL];
    self.view = cachedView;
}

The transitions work fine, but after the loading view is paged out the frame of the table view is all screwed up. THere is a black bar at the top of the same size as a status bar (I did clear the Status Bar Simulated Metrics), and the view extends below the actual bottom of the screen. The frame seems to be the same as the loadingView; on that view I have set the iPad Simulated Metrics to Master, which led to the view being about 820px tall. Regardless of that option's setting, Xcode 4 is not allowing me to change the frame of the view in the Size Inspector.

What should I do about the frame of the view?


On completion of your animation you could manually set the correct frame.

[UIView transitionFromView:self.loadingView toView:self.cachedView duration:1.0 options:UIViewAnimationOptionTransitionCurlUp completion:^(BOOL finished){self.cachedView.frame = /* Insert appropriate frame here. */;}];
0

精彩评论

暂无评论...
验证码 换一张
取 消