Create a button inside a webview
Hello,
I am finally getting around to making my Titanium 0.8 app work with iOS4+ however this means redoing it in the new version of Titanium.
My app uses webviews exclusively and all the JS is executed onload.
However it seems that none of this works. I can't even get the webview to create a simple button. Is this no longer possible?
Take this for example
<body>
<img src="images/gfb.gif" height="79" width="235" />
<div id="picker"></div>
<div style="margin-top:25px;"></div>
<div id="button1" style="height:60px"></div>
<script>
Titanium.API.info('Before button');
//Create a button for serching
var button1 = Titanium.UI.createButton({
id:'button1',
backgroundImage:'images/BUTT_red_off.png',
backgroundSelectedImage:'images/BUTT_red_on.png',
backgroundFocusedImage:'images/BUTT_red_on.png',
title:'Search nearby',
color:'#ffffff',
height:57,
fontSize:20,
fontWeight:'bold'
});
Titanium.API.info('After button');
</script>
</body>
</html>
This just doesn't work for me.
I am happy to recode this in a better way but as I was schooled in the old <0.8 way I could do with a bit more examples in how to do the above layout?
Basically its a logo, full iphone width, a picker then a large red button. (Picker code is removed from the example, just to keep things clean)
Thanks
John
2 Answers
-
Bump?
-
I use CSS3 buttons for my webviews. So you can have pretty and perso styles…