我已经实现了代码,当我按下按钮UIView包含datepicker来自底部并显示
但它会使导航栏变黑 当我按下隐藏按钮时,它会使导航栏正常 导航栏只包含标题
在UIView包含日期选择器之前我有uiscroll视图
- (void)datePickerShow
{
[UIView animateWithDuration:0.5 animations:^{
CGRect location = [self.view1 frame];
location.origin.y =[self.scrollViewProfile frame].size.height - location.size.height;
NSLog(@"%f",location.origin.y);
[self.view1 setFrame:location];
// [self.scrollViewProfile setContentOffset:(CGPointMake(0,location.size.height) ) animated:YES];
} completion:^(BOOL finished) {
}];
}
//-----------------------------------------------------------------------
- (void) datePickerHide
{
[UIView animateWithDuration:0.5 animations:^{
CGRect location = [self.view1 frame];
location.origin.y =[self.scrollViewProfile frame].size.height +location.size.height;
NSLog(@"%f",[self.scrollViewProfile frame].size.height);
[self.view1 setFrame:location];
[self.scrollViewProfile setContentOffset:(CGPointMake(0,0))animated:true];
} completion:^(BOOL finished) {
}];
}