Edit
After further testing, it appears that the part of my button that are not clickable are where the status bar used to be. I'm hiding the status bar with :
// -- Override point for customization after app launch
[[UIApplication sharedApplication] setStatusBarHidden:YES];
Also added the Boolean value to my *-info.plist file:
UIStatusBarHidden=true
Which is awesome because it hides the status bar even as the window animates up. But it's still receiving touches. Any idea on how to disable this?
Original Post
Is there's a bounding box on an application that receives touch events? I created a few sample round rect buttons and placed them in different places in my view. The ones in the center of the view receive touch events (and show the highlighted blue color) but if I place a button near the edges of the view, only parts of them are clickable in the simulator. Is this because of Apples style guidelines? I placed a button exactly where a UITabNavigationItem would appear and only the bottom half of it is clickable.
Simulator has a bug with clickability of the former status bar area. Test on the real device.
Related
I'm having a problem with UIButtons responding to a tap near the edge of an iPhone. After creating a new XCode project, dragging a button to my viewcontroller in storyboard near the left-lower corner, and running the simulator, the button appears to respond nicely to any tap over the entire surface area of the button.
However, if I run the program on an iPhone, the UIButton takes about 1 second to register with the lower-half of the button but will register immediately for the upper half of the button. Why is this? Then, when I drag the button towards the center of the iPhone screen, it registers a tap at any point across the button surface area immediately.
Try running an app with a button near the edge for yourself - do you get the same result?
Here is a screen shot of the lower-left corner of my viewcontroller - nothing special at all. I simply have a viewcontroller with buttons added along the bottom edge of the iPhone.
EDIT
Although I have not yet resolved this issue, I have discovered that the Control Center and Notification center features of the iPhone are interfering with my buttons. Does anyone know a way around this?
Adding this to my ViewController.m resolved the issue:
- (BOOL)prefersStatusBarHidden {
return YES;
}
I'm trying to implement a view that includes social buttons.In normal state, it will be partially hide and only the "Opciones" button and the upper line is shown. This view will be shown when user touches button "Opciones" (touch gesture), then it will unhide and be shown using sliding effect until the final position that is included in the attached image.
I'm wondering which kind of control and animation I have to use.
Many thanks.
on the iphone, when internet sharing is activated and another device is connected, a bar appear under the status bar. It makes the current view of the active app go down for some more 20 pixels.
I'd like to rearrange controls in my view when this new bar appears.
How can i detect when it becomes visible?
These other SO questions should point you down the right path:
How to position view below green bar during phone call?
Resize for in-call status bar?
I want to display a message to the users of my app in the UIStatusBar, but I'd like to maintain the scrollsToTop functionality so a user can tap on the statusbar and scroll a tableView up to the top.
I've looked into adding a UIWindow on top of the current status bar as in this question: Add UIView Above All Other Views, Including StatusBar
But it disables the touches to the status bar.
Note: I've seen several apps that use the statusBar area to display messages such as the "Evernote" app.
Thanks for the help!
Have a look at https://github.com/myell0w/MTStatusBarOverlay. By pressing it it can be toggled to not cover the whole status bar and then you can toch the status bar and get back the scroll-to-top feature.
Here is a screenshot, the left side shows the expanded version, the right side the shrinked one:
Are you hiding the statusBar ? It's unwise to keep it there but draw into its position, because in different countries, with different mobile operators, the statusBar's elements have a little different positions. I've seen app drawing there over status icons. Ugly!
So I guess you want to add a subview at the position of statusBar. Why don't you intercept touch events in that view and send your tableView a message to scroll to the top ?
I have this critical issue with showing top statusbar on the custom camera overlay which seems impossible for me at the moment. I posted the same question to Apple dev forum but did not get any response for some time now.
In my application, I have a custom overlay view set as the overlay to the UIImagePickerController. At the bottom of the custom overlay view (this is a UIViewController), I have put a toolbar that enables user to click on toolbar items. Since the top statusbar is not shown when the camera opens up, the whole screen get pushed upwards and makes a narrow white color gap between the bottom of the screen and the bottom tool bar.
I am not aware of how to resolve this issue, but I think if we can show the top status bar on the top of the camera then this will be automatically get resolved. Thanks for any answers.
Had a similar problem a while back and all I did was resize my view. Why not try that and see if it works.
If that doesn't work then showing the status bar should be
[[UIApplication sharedApplication] setStatusBarHidden:NO];
Thanks for the tip domino, I found how it should be done from this thread and resize the main uiview to 320x480 instead of default 320x460. Hope this will help someone else. Thanks.
Can't resize UIView in IB