Writting in a textarea inside a (xcode) WebView, causes the view to being pushed up - objective-c

Here is the scenario. I'm developing an app for ipad. This app, is just a container for a web site. I created a webview that calls a website which has a textarea.
If I click inside this textarea and the softkeyboard is displayed, the view is pushed up more than the size of the keyboard. I fixed this by using the UIKeyboardWillShowNotification notification to put the view down again.
But check this. If I write inside the textarea, the view is pushed up again, even if is just one letter.
Here are some screenshots:
this is before writting something
this is after writting something
Has somebody had the same issue? Or any clue of what is hapenning?

Ok I figure it out. It was my fault, the cause was that the main view was a TableView. Changed to a simple View and everything is now perfect

Related

Why does the iOS toolbar view get added on top of my loading view when I hide and show it again?

I have a normal navigation based iOS app
I've got "loading view" which I initiate from my app delegate and use across the app, simply by showing and hiding it.
This works fine, but as soon as I hide the bottom toolbar in one of the views in the app and display it again, the toolbar seems now be shown on top of the my generic "loading view"
Any help is much appreciated
How do you add your bottomBar? Obviously not on the view itself, right? Than it would probably be beneath the overlay.
Also you should use an extra window for the loading overlay. That would solve your issues.
I basically ended up deleting the loading view and recreating it each time.
It now appears at the top of the view hierarchy each time. This fixed the problem.

XCode: Best Way To Handle A New View In A Tabbed Application

In an iOS Tabbed Application I'm making, I've got tabs to load different viewControllers, which is pretty standard. What I'd like to do is make a few buttons (with images on them) load up another view with the button image maximized to the screen. However, I'm not really sure how to go about doing this. I don't want a new tab for this, I just want another view to show the full image, and then a button to return to the tabbed view. I've experimented a bit with making a subview to do this, and I've attempted to change the main viewport to the new view, with no success. If someone could point me in the right direction, and maybe give me a solid concept as a jumping-off point, I would really appreciate it.
And to clarify, I'm not looking for "the best way", per se. I'd be willing to accept a quick and dirty fix. But if you know of more than one way to handle this situation, I would appreciate whichever one you personally think is better.
I would do it by creating a UINavigationController to use as the primary tab view. When you want to show the full screen button, you create a new UIViewController subclass (below) and push it. That class will return YES for the method "hidesBottomBar" (its something like that).
This new view controller will be a traditional controller. You can create a UIImageView to fill the view (or you can probably replace the view with the imageView). In the viewDidLoad you'll set the UIImage of the view (or you can enter its name in the nib).
When someone clicks on the button, then you'll pop that view and return to your tabbed view (where the tab bar is showing).
I did something like this (not a big button), so I know the tab bar can be made to hide on the push. You can also hide the navigation bar so it never is even show (again, not 100% sure at the moment how to do it but its possible).

iOS: Restoring the previously visible view when the app returns to the foreground?

I'm developing an iPhone (iOS 5+) app using storyboards. The first screen of the app is a splash/login screen that checks for Facebook credentials and enables you to read and accept Terms And Conditions. In case there are valid stored credentials and the TOC has been previously accepted, this view automatically makes a modal segue (using a cross dissolve effect) to the first "real" application view, a tab bar controller with three tabs.
I'm currently implementing backgrounding and foregrounding logic. The problem is that when pressing the home button and then coming back, the login screen is briefly shown before the correct pre-backgrounding view is restored. (The Default.png of the app is of the login screen background, so it might be either that or a backgrounding-time screenshot of the actual login screen; I haven't tested replacing Default.png yet to tell the difference.)
Why is this? As far as I can tell, backgrounding the app should just take a screenshot of the view that is visible on the screen when, say, hitting the home button, and restore that prior to restoring the actual view functionality when coming back to the foreground. In this case that would be one of the tabs of the tab bar controller. Is the modal segue between the login screen and the tab bar controller the culprit here, or something else?
(I've always felt that the cross dissolve modal segue from the login screen to the first "useful" screen is a bit dirty, since IMHO a modal segue seems to imply that what your segueing to is something you'll later dismiss to get back to the "from" screen. What I'm doing now is just leaving the target of the modal segue visible indefinitely. If that is the problem here, I'd love it if someone would suggest a better method of displaying, transitioning away from and "jettisoning" the login screen.)
OK, turns out this was just a simulator/device discrepancy regarding Default.png. This comment on another question made me think to check. Time to file a bug report.
If I recall correctly, Apple has some old demo code which "remembers" which view a navigation controller was showing before it went into the background.
By way of disclaimer, I haven't worked with storyboards, so I don't know the specifics of doing what you're trying to do.
If it were me, I'd create the view controller or controllers at launch, and then only add the login screen if deemed necessary by the app delegate's logic. Only then, after setting up the view hierarchy, do I present everything.
This accomplishes two things. My login screen only exists and is visible if necessary. Additionally, the login screen won't flash unessecarily. Oh, and as a third benefit, you can present any view you like.
I'd suggest, assuming the aforementioned demo code doesn't work for you, that you'll want to save some sort of reference, tag, or ID of the currently visible view in NSUserDefaults and read that out when setting up your view hierarchy on launch.

Best way to create floating notification iOS

I've got a tabbed iPad application with just about each tab running a UIWebView. I'm getting all sorts of callbacks, like when a user tries to leave the corporate site (which only displays the company site to users). In this case, I pop up a "toast" style window that tells them to click a button to open the page in Safari. I also pop it up with a spinner and no text to indicate that a page is loading. The approximate look that I'm going for is used in lots of applications, but you can see it best when changing the volume on the iPhone or iPad. It's just a translucent rounded square that fades in and out.
Right now I've got it implemented on one of my tabs, and I did it by creating the objects (a spinner, a label, and a UIImage with the square) and then programmatically hiding and showing them using [UIView beginAnimations] and changing the label's text. It works perfectly but I've got these nagging things hovering over my interface in Xcode, and it takes a lot of setup to accomplish if I wanted it to be in another tab, which I do. I can't help but think that there's a better way to accomplish this. I thought about making and adding a subview, but that would leave a white background to the toast. What I'm thinking is creating some sort of object that I can allocate in a tab's view controller whenever it's needed.
What are your guys ideas, or have you done this in the past? I see it in a lot of prominent applications, like Reeder, so I'm sure it's been done more eloquently than I have done it.
Matt Gallagher has a great class called LoadingView here Showing message over iPhone Keyboard. I use it.
MBProgressHUD is a popular library for this, as well.

How to do a pop-up window with textfields in Objective-C?

In the iPhone Objective-C app, I want to pop-up a window (which is smaller than the main view, and the app does not stop running) when a button is tapped, with textField for the user to input text, and dismiss it when it is done.
This is widely used but I really cannot google the relevant content out.
What view should I use to connect it with the button? AlertView (which seems you cannot add dialogue in), ModalView?
Are there relevant info somewhere?
Thanks.
Make the popup it's own, full-sized window. Put a UIImageView in behind your popup screen, and duplicate the results of the normal window. That way, it will look like a popup window, but it still has the proper animation speed and everything. If you do it as a real popup, the game itself will slow down and look jumpy.
You can create any view and use UIViewController's presentModalViewController: to display a modal view controller (and even animate it).