0
Iは右UITabViewController
上方に少し通知バーを表示するために、次のコードを持っている:UIViewを画面の下部に配置するにはどうすればよいですか?
- (void)showNotificationBar
{
if(mentionsButton.hidden)
{
//DM button on the left
[dmButton setFrame:CGRectMake(20,-2, 140, 35)];
[directMessagesPill setFrame:CGRectMake(6, 7, 29, 20)];
[dmCountLabel setFrame:CGRectMake(11, 5, 19, 21)];
[directMessagesLabel setFrame:CGRectMake(43, 6, 81, 21)];
//Mentions on the right
[mentionsButton setFrame:CGRectMake(162,-2, 140, 35)];
[mentionsPill setFrame:CGRectMake(161, 7, 29, 20)];
[mentionCountLabel setFrame:CGRectMake(166, 6, 19, 21)];
[mentionsLabel setFrame:CGRectMake(193, 6, 86, 21)];
}
else
{
//Mentions on the left
[mentionsButton setFrame:CGRectMake(20,-2, 140, 35)];
[mentionsPill setFrame:CGRectMake(6, 7, 29, 20)];
[mentionCountLabel setFrame:CGRectMake(11, 5, 19, 21)];
[mentionsLabel setFrame:CGRectMake(43, 6, 81, 21)];
//DM on the right
[dmButton setFrame:CGRectMake(162,-2, 140, 35)];
[directMessagesPill setFrame:CGRectMake(161, 7, 29, 20)];
[dmCountLabel setFrame:CGRectMake(166, 5, 19, 21)];
[directMessagesLabel setFrame:CGRectMake(193, 6, 86, 21)];
}
if(!mentionsButton.hidden && !dmButton.hidden)
notificationDivider.hidden = NO;
if(!self.tabBarController.tabBar.hidden)
{
//CGRect frame = CGRectMake(0, 0, 320, 32);
CGRect frame = CGRectMake(0, 500, 320, 32);
//frame.origin.y = CGRectGetMaxY(self.navigationController.navigationBar.frame) - frame.size.height;
frame.origin.y = self.tabBarController.tabBar.frame.origin.y;
notificationBar.frame = frame;
//[self.navigationController.navigationBar.superview insertSubview:notificationBar belowSubview:self.navigationController.navigationBar];
[self.tabBarController.tabBar.superview insertSubview:notificationBar belowSubview:self.tabBarController.tabBar];
[UIView animateWithDuration:0.5 animations:^{
CGRect frame = notificationBar.frame;
//frame.origin.y = CGRectGetMaxY(self.navigationController.navigationBar.frame);
frame.origin.y -= frame.size.height;
notificationBar.frame = frame;
}];
}
else
{
CGRect frame = CGRectMake(0, 500, 320, 32);
frame.origin.y = self.navigationController.toolbar.frame.origin.y;
notificationBar.frame = frame;
[self.navigationController.toolbar.superview insertSubview:notificationBar belowSubview:self.navigationController.toolbar];
[UIView animateWithDuration:0.5 animations:^{
CGRect frame = notificationBar.frame;
frame.origin.y -= frame.size.height;
notificationBar.frame = frame;
}];
}
}
問題は、私はタブバーを非表示UINavigationController
にタブを切り替えると、このUIView
とUIToolbar
との間に隙間があると、あります。どのようにして元に戻すことができますか?