Ejemplo n.º 1
0
	b4.addEventListener('click', function()
	{
		var SubWin = require('ui/common/phone/vibrate');
		var subwin = new SubWin();
		subwin.backgroundColor = 'purple';
	
		subwin.orientationModes = [ 
			Titanium.UI.PORTRAIT, 
			Titanium.UI.UPSIDE_PORTRAIT, 
			Titanium.UI.LANDSCAPE_LEFT, 
			Titanium.UI.LANDSCAPE_RIGHT, 
			
		];
	
		var close = Titanium.UI.createButton({
			title:'close',
			width:200,
			height:40,
			top:60
		});
		subwin.add(close);
		close.addEventListener('click', function()
		{
			if (Titanium.Platform.osname == 'android')
			{
				// reset the orientation modes on the parent to ensure the orientation gets reset on the previous window
				win.orientationModes = win.orientationModes;
			}
			subwin.close();
		});
		subwin.open();
	});
		b3.addEventListener('click', function() {
			var Win = require('ui/common/phone/vibrate'),
				w = new Win({title: 'Modal Window'}),
				b = Titanium.UI.createButton( {title: 'Close'} );

			isTizen || (b.style = Titanium.UI.iPhone.SystemButtonStyle.PLAIN);
			w.title = 'Modal Window';
			w.barColor = 'black';
			w.add(b);
			b.addEventListener('click',function() {
				w.close();
			});
			w.open({ modal: true });
		});
		b3.addEventListener('click', function()
		{
			var Win = require('ui/common/phone/vibrate'),
				w = new Win({title: 'Modal Window'});
				w.barColor = 'black';
	
			var b = Titanium.UI.createButton({
				title:'Close',
				style:Titanium.UI.iPhone.SystemButtonStyle.PLAIN
			});
			w.setLeftNavButton(b);
			b.addEventListener('click',function()
			{
				w.close();
			});
			w.open({modal:true});
		});