UIToolBar missing due to iPhone Message Compose Screen within the app - iphone

Something going wrong badly due to Message Compose Screen.
I am working on a TabBar based application. In some screens I am showing ToolBar instead of tabBar by setting hidesBottomBarWhenPushed = YES; and its working fine everytime. But In 1 screen I am sending SMS by opening Message Compose Screen within the iphone App. So problem occurs if I open Message Compose Screen and i clicked Cancel button of Message Screen.
So, whenever going back to that module where I was showing ToolBar. So on click of button no ToolBar. Totally blank, no toolbar and no tabbar (tabbar is quite obvious i have already set hidesBottomBarWhenPushed).. But why toolbar now showing due to Compose screen ?
There is no link with compose screen to this screen. Far different implementation and different controllers.
I have check by debugging, Toolbar frame is also fine.
Please help

Issue fixed... had problem with adding it to keyframe window

I think it is because the MFMessageComposeViewController has got a navigation bar. Your application should be a navigation based application for that. Otherwise your toolbar's frame position will be affected. I had this kind of problem once. So i changed the application into navigation based but hid the navigation controller.
Hope this might help you,
Happy coding!

Related

Swift navigation bar animation issue

I am at a loss with what is potentially a simple fix.
I have a basic ViewController with a UINavigationController, and a UISearchBar embedded.
Basic view layout
When I PUSH a new UIViewController onto the Nav - I get a brief animation issue where a black background appears, and also the cancel button doesn't disappear.
Animation glitch
It's only brief, but annoying enough.
When I return back using the back button, the search bar reverts to white, and then switches to red.
Back display issue
I wondered if I had configured something wrong, so I created a fresh project and left everything with the defaults. Yet I get the same issue.
Stripped back and the same issue
I'm using xCode 9.3 - with swift 4.1
Any ideas?
Check the extendedLayout settings of your view controllers (these can be set in code or in the storyboard editor). They need to be the same for both view controllers or you'll get this animation glitch.
In your case the problem might be the embedded search bar. It seems to be present only for one of the view controllers. You've got navigation bars with two different heights because of that. The framework doesn't respond well to that...

iOS7 Vs iOS8 auto layout and webview issue

I have a view controller that is composed of a web view and a toolbar with some basic controls. The toolbar is pinned to the bottom of the screen using auto layout. It has four constraints, to pin it to the left side of the screen, the right side of the screen, the bottom of the screen and another that pins the bottom of the web view to the top of the toolbar.
I am having too issues with this. The first is that the web view when loading a URL has a black bar running across the bottom of the screen for a second or two while the page loads, see attached screen shot. This occurs on both iOS7 & iOS8.
[EDIT]
This bug and the one below are related I think. I just discovered that the horizontal indicator when scrolling displays not at the bottom of the screen but higher up, where it would appear if the tabbar where present.
[/EDIT]
The second issue I am having with iOS7. The screen that calls this screen is the typical navigation bar inside a tab bar setup. The user presses a button to go to a particular page, the browser gets created and pushed onto the navigation bar stack. It hides the tab bar when created. In iOS8 this works perfectly, the toolbar is pinned to the bottom of the screen. In iOS7 the tab bar is removed but the toolbar is placed as if the tab bar was still present?! Any ideas how to fix these two issues? Many thanks.
FYI - Xcode 6.1.1
The "black bar" is most likely your app window background. At the time of loading the web view is still under the navigation bar. Perhaps the constraints are being overridden. Check your storyboard settings:
If this is it, it might solve the second issue as well.
Speculation
The reason iOS 8 works is because from Apple talks I gleaned they realise many dev had issues with their views being under the nav bars by default. Introduced with iOS 7. They likely changed this in iOS 8 but found no written evidence. If someone can confirm or deny this, I'll update the answer.

can not show input method pane in UIWebView

I have created a simple UIViewController, and set a UIWebView as a default view.
When I inserted it into a NavigationController, it did not show input method anymore if I click in some text field in page.
Any ideas?
input method = soft keypad,
ps: i set the simple UIViewController as rootViewController of MainWindow, also take no effect. can not show soft keypad too.
I just encountered this. For me, the keyboard is apparently sitting behind my web view. I happened to rotate the device (in the simulator) and noticed, during the screen rotation drawing process, that I could see parts of the keyboard behind my webview. [Quoted] [1]
Interestingly, I can't seem to reproduce this problem in a freshly created sample application - yet I can't see what the problem can be with my view hierarchy. [Quoted] [2]
[1][2]: Reference
Is your web view in a modal view controller?
Pls check if the userInteraction is enabled for the web view. If not you can set it by
yourWebview.userInteractionEnabled = YES;

UINavigationItem out of sync when using popToRootViewController

I tap a tab bar item, which triggers poptoRootViewControllerAnimated. Most of the time it works as expected, but in some cases it pops to the correct view, but the navigation item is out of sync, "stuck" from the view i previously was at.
I've read about people having this problem with iPad's, when in landscape mode, but the solutions I've found don't work in this case. This is an iPhone app in portrait mode.
Happens with the simulator as well as on an actual iPhone. If someone has a suggestion or solution i'll be a very happy man!
Turns out that the different iOS versions handle this differently. This only occured on the older versions, so we had to rebuild the stack manually there.
do you get any message in the console like
nested push animation can result in
corrupted navigation bar
and
Finishing up a navigation transition
in an unexpected state. Navigation Bar
subview tree might get corrupted.
if yes take a look at these few answers...
but what they all basically mean is you are trying to pop from the navigation controller too early, probably before it is properly loaded...

UITabBar ignoring occasional "clicks"

I'm working on an iPhone app that has a UITabBar. Occasionally the tab bar ignores my "clicks" (or "taps", or whatever they're called in the iPhone world). It happens on both the simulator and the on the device. Clicking on a tab bar button won't result in any action, and I have to click it several times for the expected action to occur.
Can anybody shed any light on what might be causing this issue, or how I can go about debugging it?
I read somewhere that the UITabBar becomes unresponsive when it is not the immediate child of the window. It can be something like that or you might have a UIScrollView or some other view interfering with your UITabBar.
P.S
Click is correct for buttons, including tabs. For others, a widely used term is touch.
This might be happening bcoz the view is not getting loaded when you click on the tab.
Are you using any url request in the -(void)viewDidLoad method. If this is the case may be ur internet is workin slowly.