First Answer gets an ice cream!
not really,
I'm using web view, and I'm trying to implement Shake Gesture Could you tell me how I get this working?
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>ok?</title>
</head>
<body><script>Ti.Gesture.addEventListener('shake',function(e)
{
Titanium.UI.createAlertDialog({title:'Shake',message:'it worked!'}).show();
});
</script>test for sucess
</body>
</html>
Thank you in advance!
2 Answers
-
I'm not sure, but I don't think you're able to chain methods.
So, if that's true, you would need to var the alert, and then you can invoke the show method on the var. See below:
var myAlert = Titanium.UI.createAlertDialog({title:'Shake',message:'it worked!'}); myAlert.show();
I would try that. If it works, I'll have two scoops of rocky road, please. :)
-
I think you will need to "read" the shake event in titanium and apply it to the webview using events.
take a look at this post to see how to communicate from and to webviewhttps://developer.appcelerator.com/question/10671/webview-dom