解决方法:通知----接到通知调整各个UI
tableBar特殊 只需在tabBarCV的viewdidload里 [self layoutControllerSubViews];
- (void)layoutControllerSubViews
{
CGRect screenRect = [[UIScreen mainScreen] applicationFrame];
NSInteger addHeight = screenRect.origin.y-20;/*差为状态栏增量的高度*/
NSMutableDictionary *notifyInfo = [[NSMutableDictionary alloc] init];
CGRect rectView;
if (screenRect.origin.y > 20) {
rectView = CGRectMake(0,0,screenRect.size.width,addHeight + screenRect.size.height /*- KTabBarHeight*/);
tabBar.frame=CGRectMake(0,
addHeight + screenRect.size.height - KTabBarHeight,
screenRect.size.width,
KTabBarHeight);
[notifyInfo setValue:@"open" forKey:@"hot"];
}
else {
rectView = CGRectMake(0, 0, KDeviceWidth, self.view.frame.size.height /*- KTabBarHeight*/);
tabBar.frame = CGRectMake(self.view.frame.origin.x, self.view.frame.size.height-KTabBarHeight, self.view.frame.size.width, KTabBarHeight);
[notifyInfo setValue:@"close" forKey:@"hot"];
}
[[NSNotificationCenter defaultCenter] postNotificationOnMainThreadWithName:HotChang
object:nil
userInfo:notifyInfo];
各个UI注册通知并调整UI
tableBar特殊 只需在tabBarCV的viewdidload里 [self layoutControllerSubViews];
- (void)layoutControllerSubViews
{
CGRect screenRect = [[UIScreen mainScreen] applicationFrame];
NSInteger addHeight = screenRect.origin.y-20;/*差为状态栏增量的高度*/
NSMutableDictionary *notifyInfo = [[NSMutableDictionary alloc] init];
CGRect rectView;
if (screenRect.origin.y > 20) {
rectView = CGRectMake(0,0,screenRect.size.width,addHeight + screenRect.size.height /*- KTabBarHeight*/);
tabBar.frame=CGRectMake(0,
addHeight + screenRect.size.height - KTabBarHeight,
screenRect.size.width,
KTabBarHeight);
[notifyInfo setValue:@"open" forKey:@"hot"];
}
else {
rectView = CGRectMake(0, 0, KDeviceWidth, self.view.frame.size.height /*- KTabBarHeight*/);
tabBar.frame = CGRectMake(self.view.frame.origin.x, self.view.frame.size.height-KTabBarHeight, self.view.frame.size.width, KTabBarHeight);
[notifyInfo setValue:@"close" forKey:@"hot"];
}
[[NSNotificationCenter defaultCenter] postNotificationOnMainThreadWithName:HotChang
object:nil
userInfo:notifyInfo];
各个UI注册通知并调整UI