首页 \ 问答 \ 导航在WinJS中未按预期工作(Navigation not working as expected in WinJS)

导航在WinJS中未按预期工作(Navigation not working as expected in WinJS)

ELLO!

我有一个应用程序栏图标和点击事件 - 我添加了一个功能,其中包含以下代码:

function homePage() {

    WinJS.Navigation.navigate("/home/homePage.html");

}

现在我有两个文件 - homePage.html里面/ home /和js文件相同。

id下一页的html上有一个简单的按钮。

在homePage.js文件中,我有:

function () {
    "use strict";

    WinJS.UI.Pages.define("/home/homePage.html", {
        ready: function (element, options) {
           var button = document.getElementById("NextPage");
           button.addEventListener("click", GoToNextPage);
        }
    });
    function GoToNextPage() {
        WinJS.Navigation.navigate("/default.html");
    }

})(); 

但当我点击应用程序栏图标 - 没有任何反应:(

所以我打算完成的是当有人点击default.html上的appbar图标时 - 用户切换到homePage.html(然后当我点击homePage按钮时 - 它会返回) - 但即使是初始页面传输也没有地点。

这是令人尴尬的问,但我不能只是折叠我的手,等待一些神奇的事情发生。 我一直在研究这个问题一小时 - 阅读视频和样本,但它根本不起作用。

会感激帮助 - 我无法弄清楚出了什么问题。 谢谢!


Ello!

I have an app bar icon and on the click event - I added a function which has the following code:

function homePage() {

    WinJS.Navigation.navigate("/home/homePage.html");

}

Now I have two files - homePage.html which is inside /home/ and the js file for the same.

There's a simple button on html of id NextPage.

While in the homePage.js file, I have:

function () {
    "use strict";

    WinJS.UI.Pages.define("/home/homePage.html", {
        ready: function (element, options) {
           var button = document.getElementById("NextPage");
           button.addEventListener("click", GoToNextPage);
        }
    });
    function GoToNextPage() {
        WinJS.Navigation.navigate("/default.html");
    }

})(); 

But when I click the app bar icon - nothing happens :(

So what I plan to accomplish is that when someone clicks an appbar icon on default.html - the user switches to homePage.html (and then when I click the homePage button - it goes back) - but not even the initial page transfer is taking place.

This is embarrassing to ask but I can't just fold my hands and wait for something magical to happen. I have been working on this for an hour - read videos and samples but it's not working at all.

Would appreciate help - I can't figure out what's going wrong. Thanks!


原文:https://stackoverflow.com/questions/12438343
更新时间:2022-03-31 14:03

最满意答案

这是我用来以编程方式减慢ScrollView滚动速度的代码,

 ObjectAnimator anim = ObjectAnimator.ofInt(mScrollView, "scrollY", mScrollView.getBottom());                               
 anim.setDuration(9000);                     
 anim.start();

mScrollView - 您的ScrollView

mScrollView = (ScrollView) findViewById(R.id.scrollView1);

anima.setDuration(int Value) - 值越大,我在Switch Button OnCheckedChangedListener中使用代码块的滚动越慢。


Here is the code I used to slow down the scroll speed of ScrollView programmatically,

 ObjectAnimator anim = ObjectAnimator.ofInt(mScrollView, "scrollY", mScrollView.getBottom());                               
 anim.setDuration(9000);                     
 anim.start();

mScrollView - Your ScrollView

mScrollView = (ScrollView) findViewById(R.id.scrollView1);

anima.setDuration(int Value) - greater the value, slower the scroll I used the code block in Switch Button OnCheckedChangedListener.

相关问答

更多

相关文章

更多

最新问答

更多
  • 获取MVC 4使用的DisplayMode后缀(Get the DisplayMode Suffix being used by MVC 4)
  • 如何通过引用返回对象?(How is returning an object by reference possible?)
  • 矩阵如何存储在内存中?(How are matrices stored in memory?)
  • 每个请求的Java新会话?(Java New Session For Each Request?)
  • css:浮动div中重叠的标题h1(css: overlapping headlines h1 in floated divs)
  • 无论图像如何,Caffe预测同一类(Caffe predicts same class regardless of image)
  • xcode语法颜色编码解释?(xcode syntax color coding explained?)
  • 在Access 2010 Runtime中使用Office 2000校对工具(Use Office 2000 proofing tools in Access 2010 Runtime)
  • 从单独的Web主机将图像传输到服务器上(Getting images onto server from separate web host)
  • 从旧版本复制文件并保留它们(旧/新版本)(Copy a file from old revision and keep both of them (old / new revision))
  • 西安哪有PLC可控制编程的培训
  • 在Entity Framework中选择基类(Select base class in Entity Framework)
  • 在Android中出现错误“数据集和渲染器应该不为null,并且应该具有相同数量的系列”(Error “Dataset and renderer should be not null and should have the same number of series” in Android)
  • 电脑二级VF有什么用
  • Datamapper Ruby如何添加Hook方法(Datamapper Ruby How to add Hook Method)
  • 金华英语角.
  • 手机软件如何制作
  • 用于Android webview中图像保存的上下文菜单(Context Menu for Image Saving in an Android webview)
  • 注意:未定义的偏移量:PHP(Notice: Undefined offset: PHP)
  • 如何读R中的大数据集[复制](How to read large dataset in R [duplicate])
  • Unity 5 Heighmap与地形宽度/地形长度的分辨率关系?(Unity 5 Heighmap Resolution relationship to terrain width / terrain length?)
  • 如何通知PipedOutputStream线程写入最后一个字节的PipedInputStream线程?(How to notify PipedInputStream thread that PipedOutputStream thread has written last byte?)
  • python的访问器方法有哪些
  • DeviceNetworkInformation:哪个是哪个?(DeviceNetworkInformation: Which is which?)
  • 在Ruby中对组合进行排序(Sorting a combination in Ruby)
  • 网站开发的流程?
  • 使用Zend Framework 2中的JOIN sql检索数据(Retrieve data using JOIN sql in Zend Framework 2)
  • 条带格式类型格式模式编号无法正常工作(Stripes format type format pattern number not working properly)
  • 透明度错误IE11(Transparency bug IE11)
  • linux的基本操作命令。。。