I have an address search field in my app. When this field gets focus I want to open the keyboard as in the following image.
It works fine for iOS when the keyboard type is set to Titanium.UI.KEYBOARD_NUMBERS_PUNCTUATION as in the following code
var search = Titanium.UI.createSearchBar({
barColor:'#c8c8c8',
autocorrect:true,
hintText:'enter address',
height:'43dp',
top:'75dp',
autocapitalization: Titanium.UI.TEXT_AUTOCAPITALIZATION_WORDS,
keyboardType:Titanium.UI.KEYBOARD_NUMBERS_PUNCTUATION
});
However on Android it appears as in the following image.
I am using Titanium mobile SDK 1.7.5
You should probably add :
softKeyboardOnFocus : Titanium.UI.Android.SOFT_KEYBOARD_SHOW_ON_FOCUS
Unfortunately, it may be overridden by the system. Try it on another Android system (3.0 for example) if the problem persist.
Related
I have a simple scene in unity which has an input field in it. When I run my scene in my Android Device and press the input field, the android keyboard does not show. I am connecting via USB to my laptop using Unity Remote 5 app.
Here is my code:
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
using TMPro;
public class InputNumber : MonoBehaviour {
public InputField input;
// Use this for initialization
void Start () {
if (input)
{
TouchScreenKeyboard.Open("", TouchScreenKeyboardType.Default, false, false, true);
}
input.keyboardType = TouchScreenKeyboardType.NumberPad;
}
// Update is called once per frame
void Update () {
}
}
No need to call TouchScreenKeyboard.Open() method. The native keyboard will not show up if you are running it in Unity Remote app. But it will show up on touching input field once you build and run the app from File > Build Settings > Build or File > Build and Run.
When using the InputField component, you do not need TouchScreenKeyboard.Open to open the keyboard manually. Once the InputField is clicked on, it will open itself. Remove the unnecessary TouchScreenKeyboard.Open code.
I am connecting via USB to my laptop using Unity Remote 5 app.
That's the problem.
The InputField component will only open the keyboard when you build and run the program on the device. Unity Remote 5 is only used to detect touch on the screen and read the sensors such as the GPS and accelerometer sensors while programming on the Editor. For features supported with Unity Remote 5 see this post.
Also, TouchScreenKeyboard.Open will not work in the Editor too. You have to build and run it on the mobile device for it to work but TouchScreenKeyboard.Open is not needed here. Just build the game and deploy it to your device and the keyboard should open when you click on the InputField.
you need the Cross-Platform-Input asset from the Unity standard asset pack in the asset store. this is free, and once imported into your project will work on its own with the text field. just import it and try you phone again
then you wont need:
if (input)
{
TouchScreenKeyboard.Open("", TouchScreenKeyboardType.Default, false, false, true);
}
input.keyboardType = TouchScreenKeyboardType.NumberPad;
Unitys mobile class will just open the keyboard when you tap the field. no extra coding needed.
I use C++ Builder Tokyo 10.2.3 and trying to do something very simple on Android like typing some text into an Edit box.
If I press Next or Done key on virtual keyboard everything is fine.
If I press an Exit Button to go back the previous form it looks it is fine but then if I press Android Back button application crash.
It took me hours to identify the problem but couldn't find any solution but trying to disable all other objects when user clicks in an Edit box and enable them if user click on Next..
It seems to me a bug but need to make sure before report it to Embarcadero.
Thanks
I found the problem and a solution. In short, there is a bug in C++ Builder Tokyo 10.2.3 as if virtual keyboard on Android hide/close because of focus change on a form virtual keyboard doesn't take it as it is hidden properly.. FormVirtualKeyboardHidden working fine but I don't know somehow application crashes.
So, the solution is to using platform services. Just hide the keyboard manually on FormFocusChanged event.
void __fastcall TForm1::FormFocusChanged(TObject *Sender)
{
di_IFMXVirtualKeyboardService VirtualKeyboardService;
if(TPlatformServices::Current->SupportsPlatformService(__uuidof(IFMXVirtualKeyboardService), &VirtualKeyboardService))
{
VirtualKeyboardService->HideVirtualKeyboard();
}
}
I found an issue on TextField with property
editable = "false"
Notice that, i work on Titanium Studio and the issue concern only Android Platform.
Consider a simple window with 2 textfield, the first one have editable property set to false, the second is editable.
Now, run the app, try to enter the first textfield => you can't because is not editable, so is expected behaviour.
Next enter into the second textField which is editable, the soft keyboard get opened and you can enter some text.
Now, don't close the soft keyboard, and tap on the first textfield (the soft keyboard is still opened), you can now enter some text into the first TextField which is normally not editable !
So, somebody have an idea to solve this behaviour ?
Orating System
Name = Mac OS X
Version = 10.11.3
Architecture = 64bit
# CPUs = 4
Memory = 17179869184
Node.js
Node.js Version = 0.12.7
npm Version = 2.11.3
Titanium CLI
CLI Version = 5.0.6
Titanium SDK
SDK Version = 5.2.0.GA
SDK Path = /Users/Me/#/mobilesdk/osx/5.2.0.GA
Target Platform = android
Before upgrading my nexus 4 from Android 4.3 to 4.4(Kitkat) i could erase whith the BackSpace button a default text that i was casting on load in a TextInput. Strangely, now i cannot delete the text of this TextInput while using the default keyboard (the Google keyboard), but works perfectly with other keyboards that are available on Google Play. I don't know if it is an OS issue or my code needs modification or an upgrade to Kivy might be required.
my code looks as follows (in kv):
TextInput:
id:txt_from_mail
font_size: root.height * .044
size_hint: (None,None)
size: root.width*.65,root.height*.0833
background_color:(1,2,0.7,0.9)
foreground_color: (.2,.4,.5,.9)
padding_y:self.height*.12
text:"YourGmail#gmail.com" # this is the text that i cannot delete or modify
multiline:False
on_focus:root.clear_mail_feedback()
and in Python the function looks like that:
def clear_mail_feedback(self):
self.the_mail_feedback.text="" # this is a label in my form that gives text feedback to users
EDIT : i can also add other findings. typing text in the TextInput, put the application in the background, call back the application, and try to edit your text, you cannot! could it be an issue with latinIME? with native coding??? clueless...
This is a known issue with kitkat, kivy. There is a temp hack/fix here
I'm using the new InAppBrowser by Cordova 2.3.0.
There are some issues related to it.
First : When I click on the address bar to change the url, the keyboard isn't displayed [I run it on Android].
It only works when I click for a long time inside the textbox & choose select all , copy & paste ... then the keyboard is displayed [ & sometimes even when I do this it's not displayed].
Second: When I open a pdf file from the browser, it doesn't open ... Why ?
Thanks
The PDF issue can be fixed by setting the bridge mode to iframe
the cordova issue can be found here