后退按钮功能phonegap windows phone 7 [英] back button function for phonegap windows phone 7

查看:115
本文介绍了后退按钮功能phonegap windows phone 7的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何从Windows手机上获得返回按钮以使用PhoneGap 1.2?

How do I get the back button from Windows phone to work with PhoneGap 1.2?

现在后退按钮是退出应用程序。

Now what the back button does is exit the app.

有一个很好的文章,我不明白或得到工作的一个SO编辑: http://www.scottlogic.co.uk/blog/colin/2011/11 / handling-the-back-stack-in-windows-phone-7-phonegap-applications /
但我不明白它,我不能得到它的工作。 (甚至样例.sln对我有一个错误)

There is a good post I dont understand or get to work by one of the SO editors: http://www.scottlogic.co.uk/blog/colin/2011/11/handling-the-back-stack-in-windows-phone-7-phonegap-applications/ but I dont understand it and I cant get it to work. (even the sample .sln has an error for me)

我的应用程序是一个非常简单的index.html结构,许多html从一个页面,如果所有的后退按钮都是goto index.html,这可能对我有用。

My app is a very simple structure of index.html and many html does that come off that one page, so if all the back button did was goto index.html, that would probably work for me.

有白痴的解决方案吗?例如 - 添加此框架,但只添加到特定页面。把这里的代码,那里的代码,那些页面不需要任何东西。类似的东西?

Is there a solution for idiots? For example - add this framework but only to specific pages. Put this code here, and that code there, and those pages dont need anything. Something like that?

推荐答案

我最近发布了一个更简单的例子,用于在包含简单HTML页面的应用程序中进行后退按钮处理:

I have recently published a more simple example for back-button handling in applications that contains simple HTML pages:

http://www.scottlogic.co.uk/blog/colin/2011/12/a-simple-multi-page-windows-phone-7-phonegap -example /

实质上,有一些C#代码跟踪浏览器何时从一个页面导航到另一个页面,处理后退按钮事件以适当的方式。只需将你的代码放到www目录,它应该工作正常。

In essence, there is some C# code that keeps track of when the browser navigates from one page to another, handling the back-button event in an appropriate fashion. Just drop your code into the www directory and it should work fine.

这篇关于后退按钮功能phonegap windows phone 7的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆