Skip to content

Instantly share code, notes, and snippets.

@MotiurRahman
Last active December 30, 2015 16:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save MotiurRahman/7854701 to your computer and use it in GitHub Desktop.
Save MotiurRahman/7854701 to your computer and use it in GitHub Desktop.
Android: Cursor not showing up when clicked in Text fields
/* I have tested this jira ticket and it dose not reproduce again.
It works fine when click the text Fields show Cursor.
Testing Environment:
Titanium SDK:3.0.2 and later
Android SDK: 4.1 and later
Steps to Reproduce:
1.create a simple project.
2.Paste this code in app.js and tiapp.xml
3.Then Run this with testing environment.
*/
//Test Case
var win = Titanium.UI.createWindow({
layout : 'vertical',
title : 'TextField Test',
navBarHidden : false
});
// Create a TextField.
var text1 = Ti.UI.createTextField({
height : Ti.UI.SIZE,
top : 10,
left : 10,
width : Ti.UI.FILL,
hintText : 'This is textField1',
keyboardType : Ti.UI.KEYBOARD_DEFAULT,
returnKeyType : Ti.UI.RETURNKEY_DEFAULT,
borderStyle : Ti.UI.INPUT_BORDERSTYLE_ROUNDED
});
// Listen for return events.
text1.addEventListener('return', function(e) {
text1.blur();
alert('Input was: ' + text1.value);
});
// Add to the parent view.
win.add(text1);
// Create a TextField.
var text2 = Ti.UI.createTextField({
height : Ti.UI.SIZE,
top : 10,
left : 10,
width : Ti.UI.FILL,
hintText : 'This is textField2',
keyboardType : Ti.UI.KEYBOARD_DEFAULT,
returnKeyType : Ti.UI.RETURNKEY_DEFAULT,
borderStyle : Ti.UI.INPUT_BORDERSTYLE_ROUNDED
});
// Listen for return events.
text2.addEventListener('return', function(e) {
text2.blur();
alert('Input was: ' + text2.value);
});
// Add to the parent view.
win.add(text2);
// Create a TextField.
var text3 = Ti.UI.createTextField({
height : Ti.UI.SIZE,
top : 10,
left : 10,
width : Ti.UI.FILL,
hintText : 'This is textField3',
keyboardType : Ti.UI.KEYBOARD_DEFAULT,
returnKeyType : Ti.UI.RETURNKEY_DEFAULT,
borderStyle : Ti.UI.INPUT_BORDERSTYLE_ROUNDED
});
// Listen for return events.
text3.addEventListener('return', function(e) {
text3.blur();
alert('Input was: ' + text3.value);
});
// Add to the parent view.
win.add(text3);
win.open();
//Thanks
<android xmlns:android="http://schemas.android.com/apk/res/android">
<tool-api-level>16</tool-api-level>
<manifest>
<uses-sdk android:minSdkVersion="8" android:targetSdkVersion="16"/>
</manifest>
</android>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment