gpt4 book ai didi

web-applications - 如何创建全屏 sencha touch 2 网络应用程序?

转载 作者:行者123 更新时间:2023-12-01 16:32:11 24 4
gpt4 key购买 nike

我已经使用 sencha touch 2 创建了一个网络应用程序。现在我想让 iOS/android 在打开此应用程序时隐藏浏览器地址栏。我尝试了在互联网上找到的许多方法,但没有一个奏效。大多数人建议我按照这个问题的答案来做:how to fullscreen a Sencha Touch 2 page on a WebKit browser?

但这也不起作用。我在办公室和一些比我从事 Sencha 工作时间更长的人进行了交谈。他们说 autoMaximize 配置对他们中的任何人都不起作用,但一位前同事曾经设法通过其他方式做到这一点。

那么...有人知道让我的网络应用程序在全屏模式下运行的任何其他方法,或者为什么 autoMaximize 可能不起作用?

更新:示例代码

Ext.application({
name: 'App',

viewport: {
autoMaximize: true
},

requires : [
'Ext.Panel'
],

launch: function() {
Ext.Viewport.add({
xtype:'panel',
fullscreen:true,
html:'hi'
});
},});

更新 2:它似乎在 Android 上运行良好。

最佳答案

如果您想在移动设备上拥有真正的全屏 Web 应用程序,则必须将其部署为混合应用程序。这意味着针对 native OS SDK 进行编译。您可以使用 PhoneGap 和给定的 OS SDK 简单地完成此操作。

查看此内容以获取更多信息: http://www.sencha.com/learn/a-sencha-touch-mvc-application-with-phonegap/

在 Android 中,底线是扩展 org.apache.cordova.DroidGap 并重写 onCreate() 方法,如下所示:

public class App extends DroidGap
{
/**
* Called when the activity is first created.
*/
@Override
public void onCreate(Bundle savedInstanceState)
{
super.onCreate(savedInstanceState);
super.init();

super.setIntegerProperty("loadUrlTimeoutValue", 60000);
loadUrl("file:///android_asset/www/index.html");
}
}

其中“index.html”是您的 ST 网页。

希望有帮助。干杯。

关于web-applications - 如何创建全屏 sencha touch 2 网络应用程序?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12804478/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com