Quantcast
Channel: Appcelerator Developer Center Q&A Tag Feed (keyboard)
Viewing all 352 articles
Browse latest View live

Prevent the Keyboard from hiding AND keyboard covering text fields

$
0
0

I have a twofer.

First, I have a text field that pops up the keyboard when it goes into focus. Great. Then when the user hits enter on the keyboard, it jumps to another text field. The problem is that the keyboard drops down when the first field goes out of focus and pops back up when the second field comes into focus. Is there any way just to prevent it from being dismissed in the first place?

Second, I have a problem with a TableView not scrolling properly. When my text field goes into focus, the TableView should scroll so that it doesn't cover the text field. The first time the text field is selected, it does this as it should. But subsequently it doesn't scroll properly so it's possible that the keyboard will cover the text field. Any ideas how to fix this?

Thanks

Reed


Keyboard hide issue

$
0
0

Hi

On my login screen there is username and password field and one login button. When I run my application login screen is first screen aftre splash screen.

after splash screen when login screen loads,by default keyboard appears -- which was not issue in 3.1.3 but once i had upgraded my titanium and its sdk version to 3.2.1 problem of keyboard has been noticed.

I had tried some solution

in 3.1.3 I had done in tiapp.xml to solve this issue.

tiapp.xml

<activity android:configChanges="keyboardHidden|orientation|screenSize" android:screenOrientation="portrait"/>
same tag is there in 3.2.1 but its not solving so i had tried with other solution like.

On page load Ti.UI.Android.hideSoftKeyboard(); and also tried with $.textFieldUsername.blur()

Got solution from this but it is not the way i want. Now when it loads login screen firstly keyboard appears and then it hides.

Is there any solution so that from starting it self keyboard doesn't appear so that I do not need to hide it.

I am using alloy framework.

Blur event gets fired in textfield, when keyboard gets hidden

$
0
0

I have a Titanium.UI.TextField, which has a blur event listening on it.

If I enter the textfield, I'm getting the keyboard (makes sense)

If I click on "Done" (or what ever to hide the keyboard on iOS, Titanium.UI.TextField.returnKeyType) I get the blur event. Which makes also sense.

But now, I don't want to lose the focus, I just want to hide the keyboard, if the returnKeyType gets clicked. How do I achieve this?

thanks for the information

Android Soft Keyboard Pushing Controls Up

$
0
0

I can't seem to figure out why the appearance of the soft keyboard whilst editing a text field on Android causes some of my controls to get pushed up the page. Is there a way to stop a view or a button from being moved up? It makes a real mess!

Keyboard Height Android or similar.

$
0
0

Hello, I wonder how do I get the size of the keyboard on Android. Equal to 'keyboardframechanged' function that works only on iOS. In fact what I want to do, is a row of buttons (camera, location, etc.) similar to screen new facebook status, where the bar moves according to the keyboard.

Thank you

Autofocus keyboard on text field

$
0
0

Hi, i am having a problem of autofocus keyboard on text fields, when window open then keyboard open automatically, i don't want to show keyboard automatically. The same code is written for S4 but it is working properly on S4 but not working for S3. Please help me out. Thanks

Blocking characters from being input in textfield

$
0
0

Sorry but i need your expertise once again.

I need to be assure that the user can only type numbers on runtime or before the input is finished. Changing the keyboard to numpad isn't enough since it allows user to put spaces and plus and minus symbols on Android, and on Iphone it is possible to change the keyboard type.

I was trying to catch the event onChange but for some reason, even with a control variable, it goes into a cyclic loop.

Is it possible to block characters from the keyboard even before they are introduced into the textfield?

I've created an inputControll to save the history of the textfield value.

I've also tried to add a control variable to Alloy.Globals without success, but its not included in the code below.

.js

var inputControll = "";
 
function validateOnChange()
{
     if ($.txt_tlm.value != inputControll )
     {
        inputControll = ($.txt_tlm.value).replace(/[^0-9]+/,"");
        $.txt_tlm.value = inputControll;
        $.txt_tlm.setSelection($.txt_tlm.value.length, $.txt_tlm.value.length);
    } 
}

How to prevent auto resizing Window when softkeyboard appear?

$
0
0

Hi all,

I has a Window nad TextField inside it. every i open the Window. the soft keyboard pop up and it make the Window is resized. my question is How to prevent auto resizing Window when softkeyboard appear? Please help


How to import a Ti keyboard shortcuts csv?

$
0
0

You can click Titanium Studio -> Preferences -> General -> Keys, and change the keyboard shortcuts for almost any command. Then you can click the Export CSV button to capture all your custom shortcuts.

Question: If I send this CSV file to another Ti user, how do they import the file? I don't see any option in Ti to do this.

Android Keyboard Glitch

$
0
0

I am having an issue with the android version of a Titanium application. On iOS it works fine.

In the second window view when we click to enter a value in the following text field the keyboard will quickly appear and disappear again multiple times in a "glitchy". Then the keyboard will become stuck and even upon closing the application.

I have not been able to find any similar issues during internet searches.

if(isAndroid){
    var entry = Titanium.UI.createTextField({
        color: '#000000',
        backgroundColor: '#FFFFFF',
        keyboardType: Titanium.UI.KEYBOARD_NUMBERS_PUNCTUATION,
        returnKeyType: Titanium.UI.RETURNKEY_DONE,
        softKeyboardOnFocus: Titanium.UI.Android.SOFT_KEYBOARD_SHOW_ON_FOCUS,
        top: "9%",
        left: "1%",
        width: "49%",
        height: "12%",
        textAlign: 'left',
        font:{fontSize:"20%",fontFamily:'Roboto-Light', fontWeight:'bold'},
        hintText: 'Enter value'
    });
}

Android - Avoid keyboard opened by default on a webview on SDK 3.2.3 GA

$
0
0

Hi, I updated my Android app for SDK 3.2.3 GA. The problem is relative the "auto" open of the keyboard on every webview. I would like open the keyboard only when the user focus it; and not at the load of the webview. How can I fix this problem?

This event happen when i try the app on the device.

Titanium 3.2.3 causes unwanted soft keyboard in Android WebViews

$
0
0

I have an Alloy app built using Ti 3.2.2.GA that works well in all tested versions of Android. It includes windows that contain WebViews.

Upgrading to use Ti 3.2.3.GA, on Samsung phones (and possibly others), opening any window that contains a WebView causes the soft keyboard to appear. Any combination of the following does NOT hide the keyboard:

Ti.UI.Android.hideSoftKeyboard();
    $.details.softKeyboardOnFocus = Ti.UI.Android.SOFT_KEYBOARD_DEFAULT_ON_FOCUS;
    $.details.softKeyboardOnFocus = Ti.UI.Android.SOFT_KEYBOARD_HIDE_ON_FOCUS;
Reverting to Ti 3.2.2.GA solves the problem.

Any ideas?

UI Picker and keyboard cause app crash...

$
0
0

Hi guys, I have a problem with the UI date picker and the Keyboard: If the user doesen't confirm the suggestion and touch the date picker with the keyboard opened the app crash. If he confirm the suggestion date picker is shown correctly. Can I fix this? How can I turn off suggestions or hide the keyboard when the user touch the date picker?

Possible to do a textArea.focus to a specific character position?

$
0
0

I have a textarea and with the click of a button I can successfully have the textarea focus (and have the keyboard popup), but it focuses to the the last character of the current textArea.value.

Is it possible to have it focus to a specific character position of my choosing?

KeyboardToolBar at right.

$
0
0

Hi guys I have one keyboardtoolbar button ,but its show at left of screen. I want to do at right of screen

var send = Titanium.UI.createButton({
    title :'Send',
    right:10,
    style : Titanium.UI.iPhone.SystemButtonStyle.DONE,
});
 
var textField = Ti.UI.createTextField({
  borderStyle: Ti.UI.INPUT_BORDERSTYLE_ROUNDED,
  color: '#336699',
  top: 320, left: 4,
  width: 300, height:40,
  keyboardToolbar : [send],
  clearOnEdit:true,
  clearButtonMode :Titanium.UI.INPUT_BUTTONMODE_ALWAYS,
  keyboardToolbarColor : 'transparent',
  keyboardToolbarHeight : 30,
});

Hide soft keyboard for android and ios

$
0
0

Hi guys,

If you would like to know how to hide soft keyboard in android and ios:

signUpView.addEventListener('click',function(e){
     if(Ti.Platform.osname == 'android'){
          if(e.source.toString() != '[object TextField]'){
               Ti.UI.Android.hideSoftKeyboard();
          }
     } else {
          if(e.source != '[object TiUITextField]'){
               textField.blur();
          }
     }
});
please let me know if you guys have a better method.

Thank You

Keyword related event

$
0
0

hello all, i am implementing a text area and i need to add event listener on that text area when a key[ENTER] is pressed from hardware side. is it possible for me to do that because i dont found any resource regarding this.thanks

How to auto open keyboard when window opens

$
0
0

Am using 3.2.2 SDK, Alloy and Android 4.0. When a windows opens I need to open soft keyboard. I tried focus() in setTimeout() and so on all dint worked for me but if I place a list view its opening but I need to open keyboard without list view.

test.xml

<Alloy>
    <Window id="test">
        <View id="container">
            <TextArea id="text"></TextArea>
        </View>
    </Window>
</Alloy>
test.tss
"#test": {
    width: Ti.UI.FILL,
    height: Ti.UI.FILL,
    navBarHidden: true,
    softKeyboardOnFocus: Ti.UI.Android.SOFT_KEYBOARD_SHOW_ON_FOCUS
}
"TextArea": {
    width: Ti.UI.FILL,
    height: '50dp'
//  softKeyboardOnFocus: Ti.UI.Android.SOFT_KEYBOARD_SHOW_ON_FOCUS
}
I have tried placing TextField also but dint worked. But too many posts that keyboard opening automautically. Its weird.

Webview opens keyboard on Android

$
0
0

Hi All

I am using a webview to load a large image because imageview just doesn't work with large images.

Here is my setup for the window.

exports.create = function(model) {
 
    var self = Ti.UI.createWindow({
        fullscreen : false,
        navBarHidden : true,
        backgroundColor : '#fff'
    });
 
    var imageViewer = Titanium.UI.createWebView({
        top : '60dp',
        enableZoomControls : false,
        height :'80%',
        width : '100%',
        html : '<head></head><body marginwidth="0" marginheight="0"><img style="max-width:100%;text-align: center;" src="http://onairaustralia.com/test_site/wp-content/uploads/2013/08/Download-Hd-Dj-Music-Dance-Composer.jpg" /></body>'
    });
 
    self.add(imageViewer);
 
    return self;
 
};
But every time this window loads it opens the keyboard which seems a bit odd!!!

Has anyone got a solution for this or has experienced this before?

Thanks

Keyboard and empty TableView crashes app on iOS 7.1

$
0
0
  • Titanium SDK: 3.2.3.GA, OSX 10.9.3
  • Platform: iOS 7.1
  • Device: iOS Simulator, iOS Device

My problem is as follows: I got TableView with header view and search field inside the header. When table view is completely empty and i try to focus on text field, the app crashes with:

[ERROR] :  The application has crashed with an uncaught exception 'NSInternalInconsistencyException'.
[ERROR] :  Reason:
[ERROR] :  request for rect of invalid section (-1)
[ERROR] :  Stack trace:
[ERROR] :  0   CoreFoundation                      0x045791c8 __exceptionPreprocess + 152
[ERROR] :  1   libobjc.A.dylib                     0x03f5f8e5 objc_exception_throw + 44
[ERROR] :  2   CoreFoundation                      0x04579048 +[NSException raise:format:arguments:] + 136
[ERROR] :  3   Foundation                          0x00e1d4de -[NSAssertionHandler handleFailureInMethod:object:file:lineNumber:description:] + 116
[ERROR] :  4   UIKit                               0x014b976f -[UITableViewRowData rectForSection:] + 181
[ERROR] :  5   UIKit                               0x013365b1 -[UITableView rectForSection:] + 80
[ERROR] :  6   test                                0x000d449e -[TiUITableView keyboardDidShowAtHeight:] + 430
[ERROR] :  7   test                                0x00130487 -[TiRootViewController handleNewKeyboardStatus] + 743
[ERROR] :  8   Foundation                          0x00e735ec __NSFireDelayedPerform + 372
[ERROR] :  9   CoreFoundation                      0x04537ac6 __CFRUNLOOP_IS_CALLING_OUT_TO_A_TIMER_CALLBACK_FUNCTION__ + 22
[ERROR] :  10  CoreFoundation                      0x045374ad __CFRunLoopDoTimer + 1181
[ERROR] :  11  CoreFoundation                      0x0451f538 __CFRunLoopRun + 1816
[ERROR] :  12  CoreFoundation                      0x0451e9d3 CFRunLoopRunSpecific + 467
[ERROR] :  13  CoreFoundation                      0x0451e7eb CFRunLoopRunInMode + 123
[ERROR] :  14  GraphicsServices                    0x043215ee GSEventRunModal + 192
[ERROR] :  15  GraphicsServices                    0x0432142b GSEventRun + 104
[ERROR] :  16  UIKit                               0x0124ff9b UIApplicationMain + 1225
[ERROR] :  17  test                                0x000054c8 main + 456
[ERROR] :  18  libdyld.dylib                       0x04a5e701 start + 1
[ERROR] :  2014-07-09 17:42:14.092 test[7654:70b] *** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'request for rect of invalid section (-1)'
[ERROR] :  *** First throw call stack:
[ERROR] :  (
[ERROR] :   0   CoreFoundation                      0x045791e4 __exceptionPreprocess + 180
[ERROR] :   1   libobjc.A.dylib                     0x03f5f8e5 objc_exception_throw + 44
[ERROR] :   2   CoreFoundation                      0x04579048 +[NSException raise:format:arguments:] + 136
[ERROR] :   3   Foundation                          0x00e1d4de -[NSAssertionHandler handleFailureInMethod:object:file:lineNumber:description:] + 116
[ERROR] :   4   UIKit                               0x014b976f -[UITableViewRowData rectForSection:] + 181
[ERROR] :   5   UIKit                               0x013365b1 -[UITableView rectForSection:] + 80
[ERROR] :   6   test                                0x000d449e -[TiUITableView keyboardDidShowAtHeight:] + 430
[ERROR] :   7   test                                0x00130487 -[TiRootViewController handleNewKeyboardStatus] + 743
[ERROR] :   8   Foundation                          0x00e735ec __NSFireDelayedPerform + 372
[ERROR] :   9   CoreFoundation                      0x04537ac6 __CFRUNLOOP_IS_CALLING_OUT_TO_A_TIMER_CALLBACK_FUNCTION__ + 22
[ERROR] :   10  CoreFoundation                      0x045374ad __CFRunLoopDoTimer + 1181
[ERROR] :   11  CoreFoundation                      0x0451f538 __CFRunLoopRun + 1816
[ERROR] :   12  CoreFoundation                      0x0451e9d3 CFRunLoopRunSpecific + 467
[ERROR] :   13  CoreFoundation                      0x0451e7eb CFRunLoopRunInMode + 123
[ERROR] :   14  GraphicsServices                    0x043215ee GSEventRunModal + 192
[ERROR] :   15  GraphicsServices                    0x0432142b GSEventRun + 104
[ERROR] :   16  UIKit                               0x0124ff9b UIApplicationMain + 1225
[ERROR] :   17  test                                0x000054c8 main + 456
[ERROR] :   18  libdyld.dylib                       0x04a5e701 start + 1
[ERROR] :  )
[ERROR] :  libc++abi.dylib: terminating with uncaught exception of type NSException
-- End simulator log ---------------------------------------------------------
And TableView to reproduce crash:
<TableView id="table">
    <HeaderView>
        <View height="45" width="Ti.UI.FILL">
            <TextField top="0" height="45" width="Ti.UI.FIll" hintText="Search" />
        </View>
    </HeaderView>
</TableView>
Any help appreciated.
Viewing all 352 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>