I created a UIPickerView inside an UIActionSheet, using the following tutorial:
Add UIPickerView & a Button in Action sheet - How?
I've noticed that the UIPickerView does not respond to touches below the bottom half of the UIPicker. Perhaps just below the selection bar, but not any more below.
Has anyone had any similar experiences and resolved them?
I had a similar problem recently where I was presenting 3 options and a cancel. The lower 3 buttons seemed about half a button out of alignment. I had to click inbetween the buttons to get them to operate. It all depended on where I was presenting the action sheet from. If you have a TabBarController you should present the action sheet from there:
[actionSheet showInView:self.parentViewController.tabBarController.view];
If you just have the view itself, with perhaps a navbar then presenting it from the view is fine:
[actionSheet showInView:self.view];
In my case I had a tab bar for the iphone and not for the ipad version so I did this:
if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad) {
[actionSheet showInView:self.view];
} else {
[actionSheet showInView:self.parentViewController.tabBarController.view];
}
It's not clear from the UIActionSheet reference documentation but it might be wise to present the action sheet from the 'front' most controller that is sensible. So if there is a toolbar at the bottom present it from that. These restrictions do not appear to apply to the iPad as action sheets are presented inside popovers.
Hope that helps.
Hey go to XIB and try selecting the UIPickerView and Then Go to "Layout" Menu and "Bring To Front" Hope this helps!!
Related
I want to show more 2 "button" when touch in a tab on "UITabbarController", how can I do that.
I use UIActionSheet but when I call
[choiceSheet showInView:[self.view window]];
[choiceSheet showFromTabBar:[[self tabBarController] tabBar]];
it show UIActionSheet but still catch excepton.
As soon as there are more than 5 viewControllers inside a tabbarcontroller, the fifth entry becomes 'More...' and a list of the remaining view controllers is shown
This is the intrinsic behaviour of the UITabbarController
I have a UIViewCOntroller, and in that i have a button and a text field. When i click the button i display a UIToolBar.
Now when i click anything in the background (the textfield or the blank view) i need this UIToolBar to disappear. How can i do this programmatically ?
I know how to add a UIToolBar but all what i need to know is to hide it when the user clicks on the background.
I don't think i will have to paste any code here or show my workings so far, coz i have no clue how to get this done
- (void)viewWillAppear:(BOOL)animated{
[super viewWillAppear:animated];
[self.navigationController setToolbarHidden:YES animated:YES];
}
May be it can help you....
You will need to capture a touch on the views outside of your toolbar to achieve this. If you have a custom UIView base class that all of your other views use, you might start there. Otherwise, perhaps use some sort of toggle to show/hide your toolbar instead in your UIViewController.
The easiest way to do this is to make a single large clear button that is behind the first button but above everything else. Normally have it set to hidden but when you show the toolbar unhide the button as well. When the button is clicked have it hide the toolbar and its self. No need to do anything crazy like sub classes.
I have an app that has an UITabBarController.
I've noticed that there are like 15 pixels above the tab bar that will push the button under it. And there are like 10 more pixels that don't do anything.
The problem is that i have some button in the view that are quite close near the bar bar and when i try to touch them, the tabbar buttons get pushed.
It seems like this is standard behavior for standard UI elements. I've noticed that the buttons from the navigation bar have the same efect
Regards,
George
Some times I get this problem when i am using action sheets top of the tab bar. The button is in top of the tab bar is hard to click. Only part of the button is clicking. So what I am doing there is adding the action sheet from the parentview controller.
[actionSheet showInView:self.parentViewController.tabBarController.view];
After doing this button is working perfectly. I think you can add the button to your app like this too. Hope this will help. Thank you.
I want to rise a UIActionSheet with one normal "Cancel" button as usual, but with a few non-dismissing buttons, as all buttons on action sheet dismiss the sheet when touched down.
I've tried to add UIButtons using addSubView but Im having a tough time dealing with the ActionSheet size.
Any advice?
TY!
I don't believe you can do this with a UIActionSheet.
You could however create your own view that looks like an ActionSheet and add it to the View in question. Add some core animation to make it slide up and down and viola! You'd have a custom UIActionSheet!
I open a UIActionSheet with [actionSheet openInView:view] ... and it opens in the iPhone simulator. And you can't click on it.
Any ideas?
There is one particular issue with action sheets where the cancel button is not touchable when you present a UIActionSheet from a view inside a tab bar controller. To work around this you should present the action sheet from the tab bar controller's view:
[actionSheet openInView:self.tabbarController.view];
You should also check if your view (from which you are showing the actionsheet) is touchable or not means if the view's userinteraction is not disabled. If this is alright then check for Mike Weller's answer.
Hope this helps,
Thanks,
Madhup