Transparent Keyboard? - ios

almost finished my App. All calculations, ..... are now working.
As I have several Text Fields on the view and when I'm showing keyboard, I cannot see what I typing Field it is hidden by the keyboard.
Do you have a method for showing transparent keyboard then people will be able to see by transparency.
Regards

You'll need to add the following code in your .m file for each view you want to add the transparent keyboard to:
- (void)viewDidLoad {
[super viewDidLoad];
textField1.keyboardType = UIKeyboardTypeDecimalPad;
textField1.keyboardAppearance = UIKeyboardAppearanceAlert;
textField2.keyboardType = UIKeyboardTypeDecimalPad;
textField2.keyboardAppearance = UIKeyboardAppearanceAlert;
}
textField1 and textField2 are just examples. you need to add these 2 lines for each field. It's guaranteed way, I have 2 apps with these and just updated them 2 weeks ago and they were never rejected.
****You should change to the keyboard type you want.**

You should read the "Keyboard Management" section of the "Text, Web and Editing Programming Guide" in Apple documentation.
In the "Moving Content That Is Located Under the Keyboard" paragraph, they explains how to manage the keyboard properly and how to scroll your view so that the current text field is always visible and never hidden by the keyboard.
(source: apple.com)

There's no such thing as a transparent keyboard. You need to move your text field so that it is visible when the keyboard is displayed.

Related

Attaching a custom alert view above the iOS keyboard

I'm trying to design (a "properly designed," not "hack") custom alert view. The view should attach itself to the top of the keyboard; sliding up with the keyboard (if there is an alert) or being hidden (if there is no alert).
The view should always "stick" to the keyboard... including, for instance, when the keyboard hides. In that case, the view should slide right down, out of sight, along with the keyboard.
Here's an example of what I'm trying to achieve (with an active alert):
I have originally thought about subclassing UIAlertView, but it looks like that is not recommended. And, after experimenting a bit, this is clearly a tricky task. I've got an alert that shows up but, it turns into problems staying in sync with the keyboard, and I haven't found a way to make it "track" with the motion of the keyboard... not smoothly.
Any ideas?
You can achieve this with inputAccessoryView of UITextField and UITextView. See Custom Views for Data Input chapter in Apple's "Text Programming Guide for iOS" for more information.
For example, a very simple red bar above the keyboard can be added with the following code:
let keyboardAlertView = UIView(frame:CGRectMake(0,0,320,44))
keyboardAlertView.backgroundColor = UIColor.redColor()
textField.inputAccessoryView = keyboardAlertView

iOS 7 Messages: Fixed UITableView while still being able to bring up textfield?

I've done a lot of research before asking this question and haven't found a thorough answer. Forgive me if it's been asked somewhere else. I have been working on a messaging app for a few weeks now. Taking into account a typical messaging app (text field at bottom for user input with a table to store messages, pictures etc.) I understand that when the keyboard is shown the whole view must be pushed up to get the UITextField above the keyboard to show user input. I examined the native messages app on iOS 7 however, and I noticed that when the keyboard is shown ONLY the UITextField is moved up from the bottom of the view and the table view stays fixed (at least that's how I believe they are doing it). I know the table stays at a fixed point because when you scroll down to older messages at the top of the table, the most recent messages can be seen blurred behind the keyboard and can go all the way down the view itself while still having the keyboard visible. My question here is: is it possible to have a fixed table view while still being able to bring the text field up above the keyboard to show user input? In other words, is it possible to move just the text field up without having to move the whole view itself up?
Why not set the inputAccessoryView of the original textfield to be another textfield?
self.textFieldAtBottomOfView.inputAccessoryView = [[UITextField alloc] initWithFrame:CGRectMake(0, 0, 250, 30)];
that way you'll get a textfield that floats above the keyboard. You might need to style it to look like your first textfield and the user would think that it moved up above the keyboard on focus.

manipulating the keyboard: change frame, edit text field other than the one tapped

I'm having trouble finding info on manipulating the keyboard. Here's what I want to do:
When the user touches a text field, I want a keyboard to appear. However:
1) I want to move the keyboard up 30 pixels so that another view is visible south of it.
2) The keyboard should not actually edit the text field the user touched. A multiline text view will be presented for the user to edit instead.
I'm not sure of the best strategy and I don't know the methods I'll need to use or properties I'll need to set. Some sample code would be greatly appreciated.
As #HenryHarris says, you can't move the keyboard (or more appropriately shouldn't, as Apple expects it to be where they put it and will most likely reject your app if you start messing with it).
You can on the other hand, switch to a different view when they tap the text field by using something like this:
- (BOOL)textFieldShouldBeginEditing:(UITextField *)textField
{
// Present your text view, let's call it myTextView for now, and then tell it to start accepting input:
[myTextView becomeFirstResponder];
// Now return NO so that the textField does NOT become the first responder:
return NO;
}

Accessibility for UINavigationController and UINavigationItem

I'm improving the accessibilty of my iOS project and am using an UINavigationController.
My UINavigationItem has two buttons, the left one is "Cancel".
By default, the cancel buttons gets selected when showing the view.
So the first thing a user hears is "Cancel".
What I really want is that the title should be selected and spoken, and the
cancel button should not be selected.
Questions:
Is this how it should be, and what could be the reason for this?
Has anyone successfully unselected the button and instead selected the title?
Thanks,
Claes
From Apple's UIAccessibility Guide:
UIAccessibilityLayoutChangedNotification - Posted by an application when the layout of a screen changes, such as when an element appears or disappears. This notification includes a parameter, which is either an NSString object that VoiceOver speaks or an accessibility element that VoiceOver moves to.
So you can do something like this:
- (void)viewDidAppear:(BOOL)animated
{
[super viewDidAppear:animated];
UIAccessibilityPostNotification(UIAccessibilityLayoutChangedNotification,title);
}
You should replace "title" in the above code with the actual Accessibility element you want to be selected and spoken.
You can also use UIAccessibilityScreenChanged instead of UIAccessibilityLayoutChanged "when a new view appears that comprises a major portion of the screen".

How to stop my Custom Keyboard from 'floating' or being undocked on iPad

I have a custom Keyboard that gets displayed for a certain UITextField when I set the textField's inputView to my KeyboardView. The keyboard works fantastically well but it has become apparent that the keyboard will 'float' if the user has previously undocked the built in Apple Keyboard or indeed split it.
I have searched for many hours for a way to ensure my custom keyboard does not act like this and instead stays docked to the bottom of the screen regardless as to whether the user has previously undocked the built in Apple Keyboard.
self.keyboardInputView = [[[KeyboardInputViewController_iPad alloc]
initWithNibName:#"KeyboardInputViewController_iPad"
bundle:[NSBundle mainBundle]] autorelease];
self.keyboardInputView.delegate = self;
self.keyboardInputView.keyboardTextField = myTextField;
myTextField.inputView = self.keyboardInputView.view;
[myTextField becomeFirstResponder];
You shouldn't do this, neither is there a way to do so.
You cannot override user settings with a custom keyboard, especially not the ones that can improve the accessiblity of a user interface.
You could include a warning in the tutorial that your keyboard works best while being locked to the bottom, but you must ask yourself the question whether this is good UX or not. I would say the latter.

Resources