添加Tabbae渐隐动画效果
2016-02-23 13:05
531 查看
/**
* tabbar渐隐效果
*/
//给ViewController设置反回代理
@protocol TabBarAnimatetionDelegate
-(void)BackHideTabBarDelegateMoth:(BOOL)_Hide;
@end
//添加动画
+(void) hideTabBar:(BOOL) hidden WithTabbarController:(UITabBarController *)tabbar{
[UIView beginAnimations:nil context:NULL];
[UIView setAnimationDuration:1];
for(UIView *view in tabbar.view.subviews)
{
if([view isKindOfClass:[UITabBar class]])
{
if (hidden) {
[view setFrame:CGRectMake(view.frame.origin.x, kMainHeight, view.frame.size.width, view.frame.size.height)];
} else {
[view setFrame:CGRectMake(view.frame.origin.x, kMainHeight-49, view.frame.size.width, view.frame.size.height)];
}
}
else
{
if (hidden) {
[view setFrame:CGRectMake(view.frame.origin.x, view.frame.origin.y, view.frame.size.width, kMainHeight)];
} else {
[view setFrame:CGRectMake(view.frame.origin.x, view.frame.origin.y, view.frame.size.width, kMainHeight-49)];
}
}
}
[UIView commitAnimations];
}
* tabbar渐隐效果
*/
//给ViewController设置反回代理
@protocol TabBarAnimatetionDelegate
-(void)BackHideTabBarDelegateMoth:(BOOL)_Hide;
@end
//添加动画
+(void) hideTabBar:(BOOL) hidden WithTabbarController:(UITabBarController *)tabbar{
[UIView beginAnimations:nil context:NULL];
[UIView setAnimationDuration:1];
for(UIView *view in tabbar.view.subviews)
{
if([view isKindOfClass:[UITabBar class]])
{
if (hidden) {
[view setFrame:CGRectMake(view.frame.origin.x, kMainHeight, view.frame.size.width, view.frame.size.height)];
} else {
[view setFrame:CGRectMake(view.frame.origin.x, kMainHeight-49, view.frame.size.width, view.frame.size.height)];
}
}
else
{
if (hidden) {
[view setFrame:CGRectMake(view.frame.origin.x, view.frame.origin.y, view.frame.size.width, kMainHeight)];
} else {
[view setFrame:CGRectMake(view.frame.origin.x, view.frame.origin.y, view.frame.size.width, kMainHeight-49)];
}
}
}
[UIView commitAnimations];
}
相关文章推荐
- Android@id和@+id区别
- echarts地图 json数据 和 后套动态数据加载
- Vuln - Synology NAS DSM 5.2 Remote Code Execution (RCE)
- 【ASP.NET】巧用Cookie实战
- 如何利用ArcGIS Engine接口实现打开Raster Catalog中的某一幅指定的影像?
- OWASP ZAP2.4.3使用指南(中文版)
- struts2源码的自我理解
- Can't locate LibXML.pm
- python代码风格指南:PEP8 中文
- http://blog.csdn.net/limingchuan123456789/article/details/16849897
- 进程间关系
- HLS科普9 播放列表标签-主播放列表标签
- 链表反转
- js实现动态表格
- 麦加《解密》简评
- linux修改shell为zsh
- GitHub-版本控制
- [BZOJ2631] tree
- Could not get a databaseId from dataSource
- 正态分布,Python实现