我正在创建一个应用程序,用户可以通过相互发送电子邮件来共享数据.在这封邮件中有一个指向我的应用程序的链接(我为我的应用程序创建了一个URL方案)但是,如果用户的iPhone上没有我的应用程序,那么当他点击链接时,没有任何反应.
我的问题:如果应用程序安装在用户的iPhone上,如果未安装此应用程序,则启动Appstore或网站,如何启动应用程序?
谢谢
这是一个我想要实例化的简单视图:
Ext.define('myapp.view.Home',{
extend 'Ext.Panel',
xtype : 'testpanel' ,
config: {
title:'home',
iconCls:'home',
cls : 'home',
html: [
'<h1> Hello Guys </h1>',
'<p> some text goes here </p>'
].join("")
}
});
Run Code Online (Sandbox Code Playgroud)
我已将视图添加到我的控制器,如下所示:
Ext.define('myapp.controller.Main', {
extend : 'Ext.app.Controller',
views : ['Home'],
...
}
Run Code Online (Sandbox Code Playgroud)
我在我的应用程序中使用了xtype如下:
items:[{
xtype : 'testpanel'
},
Run Code Online (Sandbox Code Playgroud)
我仍然得到这个错误:
未捕获的错误:[Ext.createByAlias]无法创建无法识别的别名实例:widget.testpanel
我感谢您的帮助.
我一直试图理解我应该使用viewDidload几个小时:当我应该使用initWithNibName:来设置我的viewController的属性.
例如,我正在使用TableViewController,并且我在initWithNibName中设置了它的所有属性(例如backgroundColor,separateColor,工具栏项).这是正确的方法吗?
如果有人能够启发我.
谢谢
用图片理解这个问题非常简单.我有一个UINavigationController,允许用户在视图之间切换.
第一个视图包含一个搜索栏和一个表格视图,如下所示:
第二个是显示有关单元格信息的基本视图
当我单击搜索栏时,导航控制器将被隐藏,搜索栏现在位于顶部.
现在,如果我单击一个单元格,它将转到第二个视图,但导航栏首先隐藏如下:

然后,它会自动显示如下:

我在推动下一个视图控制器之前尝试了一些像显示导航栏这样的东西,但它很难看.有谁知道如何直接在第二个视图上显示导航栏(如在联系人应用程序中)?
[更新]:代码
AppDelegate.m(我说的是navigationcontroller2)
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
FirstViewController *viewController1 = [[FirstViewController alloc] initWithNibName:@"FirstViewController" bundle:nil];
SecondViewController *viewController2 = [[SecondViewController alloc] initWithNibName:@"SecondViewController" bundle:nil];
viewController1.managedObjectContext = [self managedObjectContext];
viewController2.managedObjectContext = [self managedObjectContext];
viewController1.viewController2 = viewController2;
UINavigationController *navigationcontroller1 = [[UINavigationController alloc] initWithRootViewController:viewController1];
[navigationcontroller1.navigationBar setTintColor:[UIColor lightGrayColor]];
UINavigationController *navigationcontroller2 = [[UINavigationController alloc] initWithRootViewController:viewController2];
[navigationcontroller2.navigationBar setTintColor:[UIColor lightGrayColor]];
self.tabBarController = [[UITabBarController alloc] init];
self.tabBarController.viewControllers = [NSArray arrayWithObjects:navigationcontroller1, navigationcontroller2, nil];
self.window.rootViewController = self.tabBarController; …Run Code Online (Sandbox Code Playgroud) 我跑的时候
window.onload = function () {
document.addEventListener("deviceready", getGeolocation);
}
function getGeolocation() {
navigator.geolocation.getCurrentPosition( successCallback, errorCallback, {maximumAge: 0});
}
Run Code Online (Sandbox Code Playgroud)
要么
function getGeolocation() {
watchGeoMarkerProcess = navigator.geolocation.watchPosition(updateCallback, errorCallback);
}
Run Code Online (Sandbox Code Playgroud)
然后
function updateCallback(position) {
if (position.coords.accuracy < 100) {
navigator.geolocation.clearWatch(watchGeoMarkerProcess);
}
}
Run Code Online (Sandbox Code Playgroud)
在iOS 5上使用phonegap的应用程序中,似乎卡住了,因为地理位置指示器图标保持在顶部栏中并且它永远不会消失,我认为这意味着GPS没有被关闭.此外,有时我根本没有任何坐标,抛出超时错误.
我不认为代码有任何问题,因为它作为一个webapp工作得很好.
有任何想法吗?
我正在尝试将应用程序从Sencha-Touch 1迁移到Sencha-Touch 2,我无法弄清楚以下代码的确切目的是什么:
Ext.require([
'Ext.XTemplate',
'Ext.Panel',
'Ext.Button',
'Ext.List',
'Ext.Carousel',
'Ext.NestedList'
]);
Run Code Online (Sandbox Code Playgroud)
有人可以帮帮我吗?
谢谢
所以...正如我通过Sencha Command文档阅读的那样,它告诉我构建将自动(使用Phantom JS)能够告诉我所有依赖项是什么,以及以什么顺序.基于此,我期待"sencha app build production"命令将我的所有依赖项连接到一个js文件中,无论我是否已将它们手动包含在app.json文件中.但是,我没有看到这种情况发生.
我是否必须在app.json中手动维护JS文件列表?如果是这样,那就没问题.我只是从文档中了解到不同.请帮忙.
编辑 -
所以我的index.html非常小.它只有一个外部资源js文件的脚本标记,以及'sdk/microloader/development.js'的一个脚本标记.我的index.html没有引用我的app.js.当我终止到我的应用程序目录并运行"sencha app build production"命令时,它完成没有错误.但是,当我知道我们已经超过500时,它只能找到53个依赖项.以下是运行构建时终端中的输出:
aaronfrost@topnotch ~/source/ab/AreaBook/web/src/main/webapp/sencha2 $ sencha app build -e production
[INFO] Deploying your application to /home/aaronfrost/source/ab/AreaBook/web/src/main/webapp/sencha2/build/production
[INFO] Copied sdk/sencha-touch.js
[INFO] Copied app.js
[INFO] Copied resources/css/app.css
[INFO] Copied resources/icons
[INFO] Copied resources/loading
[INFO] Resolving your application dependencies (file:////path/to/my/sencha2/index.html)
[INFO] Found 53 dependencies. Concatenating all into '/dir/to/my/sencha2/build/production/app.js'
[INFO] Processed sdk/sencha-touch.js
[INFO] Minifying sdk/sencha-touch.js
[INFO] Processed app.js
[INFO] Minifying app.js
[INFO] Minifying resources/css/app.css
[INFO] Minified sdk/sencha-touch.js
[INFO] Minified app.js
[INFO] Minified resources/css/app.css …Run Code Online (Sandbox Code Playgroud) 在我的Sencha Touch 2应用程序中,我需要自己处理重定向事件.我的意思是我需要能够处理href事件并自己进行重定向.
我正在使用以下代码:
Ext.Viewport.element.addListener("tap", function(e) {
e.stopEvent();
e.stopPropagation();
e.preventDefault();
var href = e.target.getAttribute("href");
// ... my code ...
}, this, {delegate: "a"});
Run Code Online (Sandbox Code Playgroud)
由上面提到的函数都没有工作(stopEvent,stopPropagatioon,preventDefault).应用程序始终在我的应用程序Web视图中打开链接.
这是否有任何可能的方法来禁用href打开链接?
我创建了一个静态库,其部署目标为iOS 10.2.该库集成在部署目标为9.0的应用程序中.
不知何故,该应用程序在iOS 9.0上构建并运行良好.这是为什么?应用程序是否应该构建,即使该库仅针对iOS 10.2及更高版本?
我目前正在尝试使用PhoneGap的FileTransfer.upload()方法将图片上传到服务器.它可以通过Wifi在iPhone模拟器上正常工作,但在通过3G或Wifi的Android手机上失败.
alert(error.code)返回'3',但我无法找出这个错误代码是什么.
有没有人偶然发现同样的问题并设法解决了?请帮忙.
ios ×4
cordova ×3
objective-c ×3
android ×1
extjs ×1
geolocation ×1
javascript ×1
sencha-touch ×1
upload ×1
url-scheme ×1
viewdidload ×1
xcode ×1