in my navigation based iPhone app I let users swipe the UIToolbar out of the way (I move the frame of self.navigationController.toolbar down by 23).
This works very well until the app is sent into background and reopened. When the app comes back to foreground the toolbar position is reset. This happens after UIApplicationWillEnterForegroundNotification is posted and after - (void)didBecomeActive …
At the moment I move the toolbar back to the lower position after entering foreground, but this results in kind of a flickering effect.
Could someone please push me in the right direction how I can prevent the toolbar position reset on entering foreground?
Thanks!
Don't manually change the frame of the toolbar. Call -[UINavigationController setToolbarHidden:animated:] instead.
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 developing an iOS7 app in Xcode5 and everytime i dismiss the keyboard of a UITextField, the entire window of the app shifts by 20px. This happens on both an iPad and iPhone. Does anybody have an idea why this might be the case? I tried setting the origin of the controller view back to 0,0 after the dismissal but this makes no difference.
Edit: I would like to also note that I am using custom view containment and not using UINavigationController anywhere in the project.
Edit#2: I also just realized that if I set the origin of the following to 0,0, the view shifts back into place: self.view.superview.superview.superview (dont ask me how I figured that out)
Hi I want to create a layer of the type in the image below.
The layer (with Capture mode and Shutter speed) slides up when I click on the setting button.
I am unable to figure out what should I do do create something like this. Also want to have the similar translucency in the layer as well as in the buttons on it also.
On click on the same button again, the layer(with Capture mode and Shutter speed) disappears, leaving what was there on the screen before (the camera view and the lower bar with the camera capture button, and the two setting buttons)
Please any suggestions are much appreciated.
Thanks
Maybe you can create a UIView and place every button you need there, and place it below the screen size. then when you click the setting button you call core animation to move the view up, click setting again to move it down.
i want to do a custom toolbar, something like the slide to unlock of android phones. In idle state, the user can see a button of the bottom left of the page. the user would then tap it, drag towards the right. When the user reaches the right end, the toolbar will then 'lock'. Buttons would be located at the toolbar.
I'm think of using a customview and touchmoved functions, but what I don't know how is how to make the view move with the touch, and how to actually lock the bar.
Everytime you move your finger the touchmoved function is called. In the touchmoved function you have to redraw the whole view or just set a new frame for this view. It pretty simple as you already know how to detect touches and react on them.
Is it possible to disable the home screen minimize animation effect when user presses the home button on iPhone?. Or can we set our own custom image for minimize animation?
Regards ypk
You cannot customize the minimization animation.
You can set an image to be shown full screen in applicationWillTerminate: but it wont last long as the application will quit soon after that.