I have textfield with numpad. I want to show done button on top of numpad and want to hide numpad when I click done button.
XML
<Alloy> <Window id="AddTransafer" title="" fullscreen="false" modal="true" barImage="Images/IPhone-retina_Header01.png" backgroundImage="Images/IPhone-retina_02.png" backgroundRepeat="false" onClick="closeNumPad" onFocus="loadDetails"> <TitleControl> <Label id="titleControl" color="white">MAKE A TRANSFER</Label> </TitleControl> <ScrollView contentWidth= "auto" contentHeight= "auto" showVerticalScrollIndicator= "true"> < <TextField top="290" width="527px" height="73px" id="inputAmount" hintText="Enter Amount" keyboardType="Ti.UI.KEYBOARD_NUMBER_PAD" width="527px" height="73px" borderStyle="Titanium.UI.INPUT_BORDERSTYLE_NONE" backgroundColor="#ffffff" paddingLeft="5"/> </ScrollView> </Window> </Alloy>CS
function loadDetails(){ initiateAmount(); // rest of the logic .. } function initiateAmount(){ var doneButton = Titanium.UI.createButton({ title : 'Done', width : 67, height : 32 }); doneButton.addEventListener('click', function(e) { $.inputAmount.blur(); }); $.inputAmount.keyboardToolbar = [doneButton]; $.inputAmount.addEventListener('focus', function(e) { $.inputAmount.keyboardToolbar = [doneButton]; }); }The problem is that when I click first its appearing like this. When I double clicking its working fine. It has also issues when I press done and click on field again. I am attaching the screenshot for the reference.