Question

In this link Titanium.App-event-keyboardframechanged it says that : " The event returns the dictionary containing keyboardFrame.x", I am new in programming so I want to know how to get keyboardFrame.width from this event, here is the code:

Ti.App.addEventListener("keyboardframechanged",function(e){alert("keyboard changed");});

Thanks

Was it helpful?

Solution

Like this:

Ti.App.addEventListener("keyboardframechanged",function(e){
    alert( e.width );
    alert( e.keyboardFrame.width );       
});

One of the 2 alerts must work

Cheers

OTHER TIPS

As far as I know JS, you can't return values for handler/callback functions. However, they usually provide the values via the event object, which would be e inside the function. Try inspecting what e contains.

Ti.App.addEventListener("keyboardframechanged",function(e){
  //something like e.keyboardFrame.x
});
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top