使用源代码设置控件位置/隐藏tabbar
来源:互联网 发布:师洋淘宝骂人截图 编辑:程序博客网 时间:2024/05/20 20:47
loginView.frame = CGRectMake(33,20,253,191);
self.view.center = CGPointMake(x,y)来移动view就可以解决键盘档住的问题, 其中x代表x轴的坐标,y代表y轴的坐标
原文址http://blog.csdn.net/dragoncheng/archive/2011/03/16/6254142.aspx
隐藏tabbar有两种方式:
1:在pushViewController之前调用
[self setHidesBottomBarWhenPushed:YES];
同时在viewWillDisappear调用:
- (void)viewWillDisappear:(BOOL)animated {
[self setHidesBottomBarWhenPushed:NO];
[super viewDidDisappear:animated];
}
2:使用函数:
- (void) hideTabBar:(BOOL) hidden{
[UIView beginAnimations:nil context:NULL];
[UIView setAnimationDuration:0];
for(UIView *view in self.tabBarController.view.subviews)
{
if([view isKindOfClass:[UITabBar class]])
{
if (hidden) {
[view setFrame:CGRectMake(view.frame.origin.x, 480, view.frame.size.width, view.frame.size.height)];
} else {
[view setFrame:CGRectMake(view.frame.origin.x, 433, 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, 480)];
} else {
[view setFrame:CGRectMake(view.frame.origin.x, view.frame.origin.y, view.frame.size.width, 433)];
}
}
}
[UIView commitAnimations];
}
方式一的方法代码简单,且界面也好控制一些
PS:找了好久,都是隐藏掉tabBar, 要去掉tabBar然后重新开ToolBar什么的,我最后是选择 从基函数移除tabBarController,转到NavigationController
-------------------------UISegmentedControl---------------- 引用http://blog.163.com/scelion@126/blog/static/6373749520101022102230848/
UISegmentedControl *segmentedControl=[[UISegmentedControl alloc] initWithFrame:CGRectMake(80.0f, 8.0f, 200.0f, 30.0f) ];
[segmentedControl insertSegmentWithTitle:@"Food to eat" atIndex:0 animated:YES];
[segmentedControl insertSegmentWithTitle:@"Food to avoid" atIndex:1 animated:YES];
segmentedControl.segmentedControlStyle = UISegmentedControlStyleBar;
segmentedControl.momentary = YES;
segmentedControl.multipleTouchEnabled=NO;
[segmentedControl addTarget:self action:@selector(Selectbutton:) forControlEvents:UIControlEventValueChanged];
UIBarButtonItem *segButton = [[UIBarButtonItem alloc] initWithCustomView:segmentedControl];
[segmentedControl release];
self.navigationItem.rightBarButtonItem = segButton;
[segButton release];
- 使用源代码设置控件位置/隐藏tabbar
- tabbar隐藏后,在tabbar的位置添加控件不会响应事件解决方案。
- 使用UITabBarViewCOntroller时隐藏tabbar
- Flex中如何遍历TabBar控件的各个Tab,并且通过labelPlacement属性设置标签位置
- iOS tabbar隐藏之后,隐藏位置不再被占用
- 设置导航条和tabbar隐藏
- 设置navigationBar和tabbar边框隐藏
- iOS开发tabbar的设置及隐藏
- 子控制隐藏tabBar的设置
- 隐藏 tabbar 时 页面view frame设置
- 隐藏tabbar
- 隐藏tabbar
- 隐藏tabbar
- 隐藏tabbar
- tabBar隐藏
- 隐藏tabBar
- 隐藏tabbar
- 隐藏TabBar
- 什么是分布式应用开发
- 进程线程及堆栈关系的总结
- FireFox3中input file
- DSP中GEL文件的作用
- PHP导出EXCEL快速开发指南--PHPEXCEL
- 使用源代码设置控件位置/隐藏tabbar
- javascript的对象创建和使用
- 函数指针
- 何为分布式应用开发模式
- hypervisor
- 程序员编程艺术:第三章续、Top K算法问题的实现
- 通讯录访问测试X3
- TI DSP .CMD 文件的编写[转]
- 计价方式