[英]How do I create a picker that acts like a table view on Titanium Mobile?
How do I create a pickerRow that acts like a tableViewRow with the hasChild property? 如何使用hasChild属性创建一个类似于tableViewRow的pickerRow? I wish to achieve the affect of the back button on the screen after.
我希望在之后实现屏幕上的后退按钮的效果。
Assuming that you have a TabGroup/TabView on the parent window, you can just add in a event listener in the pickerRow which you can call tabs.open(new_window), which will have the same effect. 假设您在父窗口上具有一个TabGroup / TabView,则只需在pickerRow中添加一个事件侦听器,即可调用tabs.open(new_window),这将具有相同的效果。
So: 所以:
var tabGroup = Ti.UI.createTabGroup();
var win1 = Ti.UI.createWindow({title: 'old win'});
var win2 = Ti.UI.createWindow({title: 'new win'});
var tab = Ti.UI.createTab({window: win1});
tabGroup.tabs = [tab];
tabGroup.setActiveTab(0);
var pickerRow = Ti.UI.createPickerRow();
pickerRow.addEventListener('click', function(e) { tab.open(win2); });
But then again, I've never seen a pickerRow act as a window opener, so I'm going to say this isn't 100% supported by the Titanium SDK itself. 但是话又说回来,我从未见过pickerRow充当开窗器,所以我要说Titanium SDK本身并不100%支持此功能。
原来,您需要在选择器本身上添加事件,然后可以打开一个新窗口。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.