在我的应用程序中,在某些视图中,我在底部有一个选择器,tabBar我成功隐藏了tabBar,但问题是分配给TabBar的帧也隐藏了。所以现在选择器显示只有一半可以帮助我摆脱这个问题吗?
答案 0 :(得分:2)
使用这种方法:
[actionSheetPicker showFromTabBar:self.tabBarController.tabBar];
我希望这会对你有所帮助。
答案 1 :(得分:0)
如果隐藏它,请不要隐藏tabbar,这样会产生很多问题 而不是隐藏使用此
[actionSheet showInView:self.tabBarController.tabBar];
答案 2 :(得分:0)
您无需隐藏tabbar控制器,只需将操作表添加到tabbarcontroller
[actionSheet showInView:self.tabBarController.view];
答案 3 :(得分:-1)
不要隐藏标签栏并尝试下面的代码
actionSheet=[[UIActionSheet alloc] init];
[actionSheet showInView:self.tabBarController.tabBar];
actionSheet.frame=CGRectMake(0, 100,480 ,232);
actionSheet.delegate=self;
picker=[[UIPickerView alloc] initWithFrame:CGRectMake(0, 50,480 ,175)];
picker.delegate=self;
picker.showsSelectionIndicator=YES;
[actionSheet addSubview:picker];
UIToolbar *toolbar=[[UIToolbar alloc] initWithFrame:CGRectMake(0, 0,480 ,50)];
toolbar.barStyle =UIBarStyleBlackTranslucent;
NSMutableArray *ButtonArray=[[NSMutableArray alloc ]init];
Save=[[UIBarButtonItem alloc ]initWithTitle:@"Done" style:UIBarButtonItemStyleBordered target:self action:@selector(save_pressed)];
UIBarButtonItem *titleName;
titleName=[[UIBarButtonItem alloc ] initWithTitle: @"Select Date" style:UIBarButtonItemStylePlain target:nil action:nil];
UIBarButtonItem *space=[[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemFlexibleSpace target:nil action:nil];
UIBarButtonItem *cancel=[[UIBarButtonItem alloc ]initWithTitle:@"Cancel" style:UIBarButtonItemStyleBordered target:self action:@selector(cancel_pressed)];
[ButtonArray addObject:cancel];
[cancel release];
[ButtonArray addObject:space];
[ButtonArray addObject:titleName];
[titleName release];
[ButtonArray addObject:space];
[space release];
[ButtonArray addObject:Save];
[Save release];
[toolbar setItems:ButtonArray];
[ButtonArray release];
[actionSheet addSubview:toolbar];
[toolbar release];
[actionSheet release];