简单导航 - 钛金

发布于 2024-12-19 08:27:12 字数 134 浏览 4 评论 0原文

我是一名 iPhone 开发者,也是使用 Titanium 的初学者。几天前我开始学习钛。我已经研究了一些使用窗口、视图、按钮和按钮事件的基本示例。如何使用NavgationGroup?谁能告诉我如何在触发按钮时导航/推送新视图?只是我需要知道按钮事件。

I am an iPhone developer and a beginner in using Titanium. I have started learning Titanium few days back. I have worked on some basic samples which uses a window, views, button and button events. How can I use NavgationGroup? Can anyone say me how to navigate/push a new view when a button is triggered? Just I need to know the button event.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

素手挽清风 2024-12-26 08:27:12

如果您已经定义了导航组,例如:

var first = Ti.UI.createWindow({
     backgroundColor:"#fff",
     title:"My App"
   });

   var navGroup = Ti.UI.iPhone.createNavigationGroup({
      window:home
    });

    var button = Titanium.UI.createButton({
       title: 'Open new window'
    });

    first.add(button);

按钮侦听器将像这样,您可以在其中打开一个新窗口:

var second = Ti.UI.createWindow({
    background:"#fff",
     title:"Child Window"
});
second.add(Ti.UI.createLabel({text:"Here's the child"}));

button.addEventListener("click", function(e) {
  navGroup.open(second);
});

有一个与您的问题相关的完整示例 操作方法:创建 iPhone 导航组。这可能对你有帮助。

If you have already defined your navigation group like:

var first = Ti.UI.createWindow({
     backgroundColor:"#fff",
     title:"My App"
   });

   var navGroup = Ti.UI.iPhone.createNavigationGroup({
      window:home
    });

    var button = Titanium.UI.createButton({
       title: 'Open new window'
    });

    first.add(button);

Button listener will be like this where you can open a new window:

var second = Ti.UI.createWindow({
    background:"#fff",
     title:"Child Window"
});
second.add(Ti.UI.createLabel({text:"Here's the child"}));

button.addEventListener("click", function(e) {
  navGroup.open(second);
});

There is a complete example related to your question How-To: Create an iPhone Navigation Group. This may help you.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文