Titanium Community Questions & Answer Archive

We felt that 6+ years of knowledge should not die so this is the Titanium Community Questions & Answer Archive

Toolbar view gets covered by keyboard

If I create a toolbar view with the same controls as the iPhone SMS app (textfield & send button) and anchor it to the bottom of the screen when I click into the textfield it gets covered up by the keyboard.

What am I missing? how do I get the toolbar to move and show above the keyboard?

— asked March 26th 2010 by Michael Bollman
  • keyboard
  • textfield
  • toolbar
0 Comments

2 Answers

  • Add the toolbar also to the keyboard, not only to the bottom of the window or view

    var send = Titanium.UI.createButton({
        title: 'Send',
        style: Titanium.UI.iPhone.SystemButtonStyle.DONE,
    });
    var camera = Titanium.UI.createButton({
        systemButton: Titanium.UI.iPhone.SystemButton.CAMERA,
    });
    var cancel = Titanium.UI.createButton({
        systemButton: Titanium.UI.iPhone.SystemButton.CANCEL
    });
    flexSpace = Titanium.UI.createButton({
        systemButton:Titanium.UI.iPhone.SystemButton.FLEXIBLE_SPACE
    });
    var toolbar = Titanium.UI.createToolbar({
        items:[send, flexSpace, camera, flexSpace, cancel],
        bottom:0,
        borderTop:true,
        borderBottom:false
    });
    var txtf_1 = Ti.UI.createTextField({
        width:200,
        height: 30,
        top:100,
        left:100,
        borderStyle: Ti.UI.INPUT_BORDERSTYLE_ROUNDED,
        keyboardToolbar: toolbar //Here the toolbar will appear over the keyboard
    });
    
    — answered August 16th 2012 by Eugenio Melendez
    permalink
    1 Comment
    • Isn't the toolbar deprecated since 1.80? I have checked the api. It'd better to use Ti.UI.iPhone.createToolbar, but doesnt that mean Android cannot use toolbar?

      Thanks!

      — commented November 17th 2012 by Haoyang Li
  • try this example from kitchensink

    — answered July 18th 2011 by John Brennan
    permalink
    0 Comments
The ownership of individual contributions to this community generated content is retained by the authors of their contributions.
All trademarks remain the property of the respective owner.