I have created Rich Text Editor using UIWebView . I want to show keyboard without tapping uiwebview , means when i open editor keyboard should be open and uiwebview should be editable.
Just write this delegate method:
- (void)webViewDidFinishLoad:(UIWebView *)webView {
webView.keyboardDisplayRequiresUserAction = NO;
[webView stringByEvaluatingJavaScriptFromString:#"document.getElementById('content').focus()"];
}
content is the element's id.
Related
I have to implement a rich text editor, For which i have to create a custom keyboard. But i don't know how can i use custom keyboard with UIWebview. I must have to use UIWebview because i have to java script also in my editor.
Check this article link
Custom Keyboard in UIWebView He suggests to use a UITextField as a "media" when you detect keyboard coming up inside a UIWebView. Thus, you can use whatever Keyboard type you want on the UITextField. After users taps something, copy the text in UITextField the media via JavaScript ActiveDocument.
How to hide/disable keyboard ,if the textview editing is enabled.
I only want to that user can only be able to select the text and can't be allowed for entering text.
Because selected text will be converted in to image for move animation.
User will not be allowed for entering any text in textview so that's why keyboard should be hidden or disable ,he will be allowed only for text selection.
uitextview.editable = NO; or set checkmark in IB. It will allow to select text with options - Copy and Select All without keyboard appearing. Tap on the word and hold to select text.
ok just uncheck the behavior of you UItextview in .xib file.
Something to try it the 'editable' setting doesn't work out is to create a UIView that's hidden and out of the way somewhere and assign it as the inputView for the text view. If that property is non-nil, the view it contains will be shown instead of the keyboard.
Such as:
self.textView.inputView = [[[UIView alloc] initWithFrame:CGRectMake(0, 0, 1, 1)] autorelease];
try this
yourtextview.UserinterationEnable=No;
This will make the keyboard disappear:
[[[UIApplication sharedApplication] keyWindow] endEditing:YES];
This what you want to do?
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.
I am working on an web service based application. I need Loading/waiting imageview that should disable my Tabbar & Navigationbar of the screen till Loading of web service . The issue when I keep the imageview that contains the waiting animation over in my viewcontroller, it disables only self.view. Can anybody please tell what i went wrong?
Regards,
sathish
You can either hide the tab bar by tabbar.hidden=YES or if you want to remove the tab bar from the window and put it again, you need to release the tab bar and then allocate it again...
But releasing the tab bar will make your app crash, so before releasing the tab bar remove it from super view.
[TabBarController.view removeFromSuperview];
[TabBarController release];
then allocate it again and put it on the window
[self createTabBar]; // createTabBar is a function creating a tab bar
[self.window addSubview:TabBarController.view];
[self.window makeKeyAndVisible];
I have a UITextfield for entering text. A button triggers a functionality. After completion of the IBAction the UITextfield is getting focused again. After the IBAction I want to keyboard to disappear. What happends now is that due to the IBAction of the button, the keyboards disappears (I'm showing a UIAlert) and after the IBAction the keyboards pop's up again together with the focus in the UITextfield. Is it possible to prevent the UITextfield to be focused after the IBAction?
Before displaying the alert, call [resignFirstResponder] on the UITextField.
Found the problem. While carrying out the operations in the IBAction method I was locking the view with:
[self.view setUserInteractionEnabled:NO];
// do the job
[self.view setUserInteractionEnabled:YES];
This activates the UITextfield again. So I put a [self.hostName resignFirstResponder]; directly behind the setUserInteractionEnabled:YES.
So after coming back from the IBAction nothing is focused.
SOLUTION:
[self.view setUserInteractionEnabled:NO];
// do the job
[self.view setUserInteractionEnabled:YES];
[self.hostName resignFirstResponder];