Trouble creating modal window on iPad
I'd like to create a model window that looks much like the Mail version – 70% of the screen width.
I'm using the code direct from the documentation, and then doctoring as an experiment. I've tried any number of widths just to see if I'm missing something. It doesn't seem to have an effect.
var window = Titanium.UI.createWindow();
window.open({
modal:true,
modalStyle: Ti.UI.iPhone.MODAL_PRESENTATION_FORMSHEET,
width: 300
});
It opens, but always as full screen (plus title bar). Appreciate any suggestions…
Best,
Nate
9 Answers
-
For those that may be wondering about this, I'm using Titanium SDK 1.8.2, and this is working on the iPad (where the modal is not full screen).
var myModal = Ti.UI.createWindow({ //... }); myModal.open({ modal:true, modalTransitionStyle: Ti.UI.iPhone.MODAL_TRANSITION_STYLE_COVER_VERTICAL, modalStyle: Ti.UI.iPhone.MODAL_PRESENTATION_FORMSHEET });
-
Hey Nate,
I see that Kevin Whinnery from Appcelerator has posted some sample code for an iPad app here. I haven't started iPad development yet so I can't tell you what might be going on, but hopefully looking at Kevin's sample code will help.
Good luck!
-
Hi All,
I'm having exactly the same issue. Can't get the modal on the iPad to display as a Modal, it's showing full screen. Has anyone had the same issue and resolved this?
Regards
Paul
-
I've just upgraded to 1.3.2 but still seeing the same issue, here's the crux of my code:
var modalWindow = Ti.UI.createWindow({ title:'Choose News Source', backgroundColor:'#000', barColor:'#000', url:'news_source.js' }); addBtn.addEventListener('click',function(e) { modalWindow.open({ modal:true, modalTransitionStyle: Ti.UI.iPhone.MODAL_TRANSITION_STYLE_COVER_VERTICAL, modalStyle: Ti.UI.iPhone.MODAL_PRESENTATION_FORMSHEET }); });
news_source.js just has a text box in at the moment, nothing else.
Any thoughts?
-
addBtn.addEventListener('click',function(e) { var modalWindow = Ti.UI.createWindow({ title:'Choose News Source', backgroundColor:'#000', barColor:'#000', url:'news_source.js' }); modalWindow.open({ modal:true, modalTransitionStyle: Ti.UI.iPhone.MODAL_TRANSITION_STYLE_COVER_VERTICAL, modalStyle: Ti.UI.iPhone.MODAL_PRESENTATION_FORMSHEET }); });
-
Many thanks Daniel, but still no luck, here's the full code:
var mainWindow = Ti.UI.createWindow(); // WINDOWS var win = Ti.UI.createWindow({ title:'First Window', backgroundColor:'#000', barColor:'#000' //rightNavButton: addIcon }); var addBtn = Titanium.UI.createButton({ backgroundImage:'images/icons/addNavBar.png', width:33, height:29 }); win.rightNavButton = addBtn; addBtn.addEventListener('click',function(e) { var modalWindow = Ti.UI.createWindow({ title:'Choose News Source', backgroundColor:'#000', barColor:'#000', url:'news_source.js' }); modalWindow.open({ modal:true, modalTransitionStyle: Ti.UI.iPhone.MODAL_TRANSITION_STYLE_COVER_VERTICAL, modalStyle: Ti.UI.iPhone.MODAL_PRESENTATION_FORMSHEET }); }); // NAV GROUP var navGroup = Ti.UI.iPhone.createNavigationGroup({ window:win }); mainWindow.add(navGroup); mainWindow.open();
Really starting to bug me now. If it makes any difference I'm using iOS3.2, xCode 3.2.3 and Titanium 1.2.1 using SDK 1.3.2
Nothing to do with opening from a Nav Group?
Cheers
Paul -
Ok, I've even installed this directly onto my iPad and the Modal doesn't work. It is just showing fullscreen.
I'm using SDK 1.3.2. iOS SDK is 3.2, iOS on iPad is 3.2.1. Titanium Developer is 1.2.1. xCode is 3.2.3
Has anyone actually got the modal to work (like the email example in the docs) yet, and if so what setup have you got. This is really frustrating me as its my first app, and literally the first window I'm using. :-)
Any help would be gratefully appreciated (especially from the appcelerator folks)
Paul
-
Still nothing on this? Appcelerator is really dropping the ball on iPad support. The amount of glitches and bugs basically makes it useless for developing any type of quality application.
-
any changes on this topic?