How can I prevent edit text being hidden by the Android keyboard? - android-layout

I have around 4-5 edit text on the screen, now when user types, some EditText are hidden behind the soft keyboard and user can not see what he is typing.
Please give ideas what can be done.
Thanks

Ok.. I got the solution put a LinearLayout containing all TextViews and EditText in scroll view and then when user presses next view is scrolled and user will be able to see what he is typing.

Related

Adding button to layout and it will not show up

I'm adding a button to a linear layout and it does not show up. Main XML after adding button last button:
Preview button does not show:
I use AIDE as well, it isn't quite reliable. Nor is its Design preview. So, basically, if your codes are correct just build the app and see what happens.
There are no place for the third button.
Reduce string length in android:text of all buttons and check that button appears, or make linearlayout orientation vertical and check.
You must learn about "weight" attribute...

IME in landscape view is not working - Next button does not respond

I have an app, one activity is a form with multiple fields. In landscape mode when clicking into the first field the fullscreen IME kicks in, with a "Next" button.
The "Next" button, however, does not respond at all. No errors are thrown, nothing logged related to this - it just doesn't move to the next (of about 12) text fields.
Same (lack of) behavior when other fields are selected on the form and text entered/not entered in landscape view - non-responsive next button.
The final EditText field correctly shows a "Done" button...which is also unresponsive.
I've had no luck searching forums and Googling this, and nothing I've been able to find related to the IME has helped to this point.
One option, of course, is to force portrait mode (which works fine), but I would rather avoid that klunky workaround.
Any suggestions, references to code/examples related to this would be greatly appreciated.
Resolved using android:imeOptions="actionDone" in the EditText layout if the next element is not an EditText view, or if at the end of the form. All other EditText layouts added android:imeOptions="actionNext".
This allows a full-screen IME in landscape view to navigate from one EditText to the next, form an EditText out of the IME if the next field is a button or spinner (any non-EditText field), and exit the full-screen IME after the last form field.

A keyboard with a UITextField

I have a table listing some strings, and what I want is when I tap the add button on the navigation bar, a keyboard with a textField would jump up, so I can input a string in the textField, then when I tap the return key, the keyboard disappear as well as the textField, and the new string is added to the table.
I already make up a nib file with a toolBar containing a textField, and I just failed to go on.
How can I implement this idea? Use the inputAccessoryView? If so, that means the inputAccessoryView of the textField which belongs to the toolBar is gonna be the toolBar itself!
This seem kind of weird and I have not been able to make it work till now.
Or is there another way for this idea?
Thanks a lot!
I've solved the problems by using notification instead of inputAccessoryView.
There is a sample code in XCode called "KeyboardAccessory", and it gives a good example about using keyboard notifications!
Or custom a view with a tab, and set it as the textField's inputAccessoryView, that would also work!

Dismiss spinner control popup if you don't want an item in android

I have an android spinner which I call via the performClick method to show a list of items (the actual control is hidden from the user and is called from a checkbox, too complex to explain why I have done it this way).
If I do not want an item in the list, how can I dismiss the popup by clicking on the black area?
Does this make sense? :/
Edit: Sorry, forgot to mention that the users will not be able to operate the bottom buttons (device is going to be galaxy tab) as they will be covered up with protective layer due as they will be outdoors.
usually such a control is dismissed using the back key in the android applications. So I would suggest that you find a way to do it the same way on your control.
'Esc' button should do the same job..

inputAccessoryView not hide the view when -resignFirstResponder?

I have attached a toolbar with a UITextField and UIButton to the keyboard when it becomes the first responder via the user taping inside the textfield
textField.inputAccessoryView = theToolbar;
Problem is, the toolbar disappears when the keyboard is dismissed, thus preventing any further input.
Any ideas on how to make the toolbar go back to the bottom of the screen rather than off it completely?
I'm thinking a delegate method might help but Im really not too sure. It seems once the inputAccessoryView always the inputAccessoryView :(
Cheers
The input accessory view is automatically dismissed with the input view (the keyboard, in this case). Generally you do not want to have an input accessory view in your view hierarchy. Instead, if you want your toolbar to scroll up when the keyboard is shown, you should follow the guidelines for Managing the Keyboard.
You could try using an additional toolbar that is offscreen as the inputAccessoryView, which could "fake" the appearance of what you are trying to do. Alternatively, have you tried adding the toolbar back to the bottom of the screen using
[self.view addSubview:theToolbar];
when the keyboard reaches the bottom of the screen? You can use keyboard notifications for this.

Resources