0
A
回答
3
你需要像this video这样的东西吗?
下面是一个简单
下面是其他
这些,这里是我的方法来实现这一点:
- 创建工具栏。
- 创建BottomView(应该是背后的工具栏。
- 工具栏上的
- 添加SwipteGestures与向上&向下的方向在目标方法,只是做动画动起来&了下来。
这里我写了短短几分钟前,可以帮助Y中的代码。
// add the variables
UIToolbar *myToolBar;
UIView *hiddenView;
BOOL movedUP;
-(void)addToolBar{
[self addBottomMostHiddenView];
UIBarButtonItem *spaceItem = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemFlexibleSpace target:nil action:nil];
[self.navigationController.toolbar setBarStyle:UIBarStyleBlackOpaque];
UIBarButtonItem *one = [[UIBarButtonItem alloc] initWithTitle:@"One Item" style:UIBarButtonItemStylePlain target:self action:nil];
UIBarButtonItem *drag = [[UIBarButtonItem alloc] initWithImage:[UIImage imageNamed:@"icon-drag-64.png"] style:UIBarButtonItemStylePlain target:self action:nil];
drag.enabled = NO;
UIBarButtonItem *two = [[UIBarButtonItem alloc] initWithTitle:@"Two Item" style:UIBarButtonItemStylePlain target:self action:nil];
NSArray *toolbarItems = [NSArray arrayWithObjects:one,spaceItem, drag, spaceItem , two, nil];
myToolBar = [[UIToolbar alloc]initWithFrame:CGRectMake(0, 430, self.view.frame.size.width, 80)];
myToolBar.tintColor = [UIColor whiteColor];
myToolBar.barTintColor = [UIColor colorWithRed:53.0/255.0 green:70.0/255.0 blue:103.00/255.00 alpha:1];
[self.view addSubview:myToolBar];
[myToolBar setItems:toolbarItems animated:YES];
UISwipeGestureRecognizer *upGesture = [[UISwipeGestureRecognizer alloc]initWithTarget:self action:@selector(dragMe:)];
upGesture.direction = UISwipeGestureRecognizerDirectionUp;
[myToolBar addGestureRecognizer:upGesture];
UISwipeGestureRecognizer *downGesture = [[UISwipeGestureRecognizer alloc]initWithTarget:self action:@selector(dragMe:)];
downGesture.direction = UISwipeGestureRecognizerDirectionDown;
[myToolBar addGestureRecognizer:downGesture];
}
-(void)addBottomMostHiddenView{
hiddenView = [[UIView alloc]initWithFrame:CGRectMake(0, 510, self.view.frame.size.width, 40)];
UIImageView *image = [[UIImageView alloc]initWithImage:[UIImage imageNamed:@"iconProgress.png"]];
[hiddenView addSubview:image];
[hiddenView setBackgroundColor:[UIColor colorWithWhite:0.2 alpha:0.8]];
[self.view addSubview:hiddenView];
}
-(void)dragMe:(UISwipeGestureRecognizer *)gesture {
[UIView animateWithDuration:0.5 animations:^{
if(gesture.direction == UISwipeGestureRecognizerDirectionDown) {
if(movedUP) {
myToolBar.frame = CGRectMake(0, 430, self.view.frame.size.width, 80);
hiddenView.frame = CGRectMake(0, 510, self.view.frame.size.width, 80);
movedUP = NO;
}
}else if(gesture.direction == UISwipeGestureRecognizerDirectionUp) {
if(!movedUP) {
myToolBar.frame = CGRectMake(0, 390, self.view.frame.size.width, 80);
hiddenView.frame = CGRectMake(0, 470, self.view.frame.size.width, 80);
movedUP = YES;
}
}
}];
}
希望OU。
相关问题
- 1. 与图像底部的工具栏的iOS 7应用
- 2. CoordinatorLayout底部的工具栏
- 3. 底部工具栏与3图像
- 4. 棒工具栏底部
- 5. 底部工具栏布局
- 6. 底部工具栏不使用顶部工具栏和工具栏bootom成像这样的面板显示
- 7. 如何在工具栏的底部定位一个工具栏?
- 8. 工具栏:底部菜单的背景
- 9. 定制emacs中的底部工具栏
- 10. iOS应用程序工具栏底部的箭头
- 11. AdMob横幅封面底部工具栏
- 12. UITableViewController底部工具栏不起作用?
- 13. 坞工具栏底部垂直布局
- 14. QLPreviewController隐藏底部工具栏
- 15. 添加MPVolumeView至底部工具栏
- 16. 工具栏标题显示在底部
- 17. iOS - 将工具栏粘贴到滚动底部
- 18. 工具栏中的酒吧按钮项底部的快捷栏
- 19. 在工具栏底部边缘显示的工具栏向上箭头图标
- 20. 删除工具栏和状态栏底部的边框
- 21. .NET Ajax工具包HtmlEditorExtender不显示底部工具栏
- 22. 如何解决职位:固定在iOS上的底部工具栏(iPhone/iPad)
- 23. 使用适用于安卓和iOS的xamarin表单创建底部工具栏
- 24. 如何将工具栏添加到UITableView的底部obj-c/ios/xcode
- 25. Phonegap IOS工具栏
- 26. jquerymobile设计像IOS工具栏
- 27. 的Android:滑动片(在底部的工具栏)
- 28. 如何让我的工具栏底部的边框?
- 29. 带详细视图底部的工具栏/ tabbar的UISplitView
- 30. 如何在DHTMLX中创建底部工具栏(状态栏)?
请以计算方式设置框架,而不是硬编码方式。我只是为了给你提供线索。 –