我不确定这是一个合适的问题,但IOS的新Chrome应用只是一个UIWebView吗?
如果是这样,那么可以安全地假设它和移动Safari之间不应该存在任何渲染差异吗?
有没有其他人,他们在iOS 6应用程序中使用地图,注意到极高的内存使用,一直到接收内存警告到崩溃的应用程序?
我通过仪器运行应用程序,我没有看到任何泄漏,直到创建地图视图,应用程序始终以大约3mb Live Bytes运行.创建地图并下载切片后,Live Bytes会跳至~13mb Live Bytes.然后,当我移动地图并放大和缩小Live Bytes连续体时,直到应用程序崩溃在大约40mb Live Bytes.顺便提一下,这是在iPhone 4上.在iPod touch上它甚至更早崩溃.
我正在重复使用注释视图,没有任何泄漏.是否有其他人在使用新的iOS 6地图时看到了相同的高内存使用量?还有,有没有人有解决方案?
我正在尝试使用路径和查询参数的混合导航到Angular 2中的路线.
以下是路径是路径最后一部分的示例路由:
{ path: ':foo/:bar/:baz/page', component: AComponent }
Run Code Online (Sandbox Code Playgroud)
试图像这样链接使用数组:
this.router.navigate(['foo-content', 'bar-contents', 'baz-content', 'page'], this.params.queryParams)
Run Code Online (Sandbox Code Playgroud)
我没有得到任何错误,从我能理解的这应该工作.
Angular 2文档(目前)以下为例:
{ path: 'hero/:id', component: HeroDetailComponent }
['/hero', hero.id] // { 15 }
Run Code Online (Sandbox Code Playgroud)
谁能看到我哪里出错了?我在路由器3上.
几乎所有主要新闻媒体都报道苹果将停止在iOS6中使用谷歌地图服务.我认为没有人真正知道这些变化究竟是什么,什么时候推出,苹果将如何实施它们以及Google或Apple是否会开始为其服务收费.由于存在这些不确定因素,我无法就是否应该发布一个我已经工作了一年多的新公共汽车追踪器应用程序做出明智的决定.我已经设定了2012年6月15日的最初硬截止日期.我知道最好的办法是等待,看看将会发生什么变化以及Apple将如何实施这些变化.但我有点不耐烦并且强调要推迟发布日期,因为任何进一步的延迟都会以非常重要的方式影响我的许多其他计划.
有关该应用的更多信息:
它根据从第三方运输机构的API获得的信息提供实时公共交通信息.它在很大程度上取决于iOS MapKit框架和iOS位置服务,以实时显示给定路径上的总线的当前地理位置,并在两个位置之间提供传输信息.据Apple称,iOS MapKit框架使用Google服务提供地图数据.某些功能会调用Google地图应用以提供到最近站点的中转计划和转弯路线指示.
我的问题:
如果谣言成真,你认为Apple肯定会实施任何改变而不会影响已经使用当前MapKit框架的应用程序吗?我应该准备什么样的潜在问题?
我正在构建一个可以打开地图应用的应用,其中包含从用户当前位置到另一个位置的路线.代码如下所示:
- (id)resolveDirectionsFromCoordinate:(CLLocationCoordinate2D)startCoordinate toCoordinate:(CLLocationCoordinate2D)endCoordinate
{
NSString* url = [NSString stringWithFormat: @"http://maps.google.com/maps?saddr=%f,%f&daddr=%f,%f",
startCoordinate.latitude, startCoordinate.longitude,
endCoordinate.latitude, endCoordinate.longitude];
[[UIApplication sharedApplication] openURL: [NSURL URLWithString: url]];
return nil;
}
Run Code Online (Sandbox Code Playgroud)
这些在iOS 5.x中运行良好.但是,在iOS 6中,由于地图不再使用Google地图,因此会显示Safari.
有谁知道我应该在iOS 6中调用哪个URL?
所以我开始关注Ramda/Folktale.我在尝试映射来自目录的任务数组时遇到问题.我正在尝试解析文件内容.
var fs = require('fs');
var util = require('util');
var R = require('ramda');
var Task = require('data.task');
var compose = R.compose;
var map = R.map;
var chain = R.chain;
function parseFile(data) {
console.log("Name: " + data.match(/\$name:(.*)/)[1]);
console.log("Description: " + data.match(/\$description:(.*)/)[1]);
console.log("Example path: " + data.match(/\$example:(.*)/)[1]);
}
// String => Task [String]
function readDirectories(path) {
return new Task(function(reject, resolve) {
fs.readdir(path, function(err, files) {
err ? reject(err) : resolve(files);
})
})
}
// String => Task String
function readFile(file) {
return …
Run Code Online (Sandbox Code Playgroud) javascript functional-programming ramda.js folktale fantasyland
这是一个奇怪的问题:我的应用程序应该能够调用iOS中的内置地图(包括5.1和6).事实证明它在iOS6下工作得很好,但在iOS5.1下却没有.调用iOS6中的地图,并跟踪从saddr到daddr的路线,但是当我在iOS5中时,地图应用程序被调用,但只有一个引脚放在daddr上.由于某种未知原因,初始坐标(saddr)没有显示,也没有跟踪方向.
这是我的代码:
addr = [NSString stringWithFormat: @"maps://saddr=%f,%f&daddr=%f,%f", newLocation.coordinate.latitude, newLocation.coordinate.longitude, oldLatitude, oldLongitude];
NSURL *url = [NSURL URLWithString:addr];
[[UIApplication sharedApplication] openURL:url];
Run Code Online (Sandbox Code Playgroud)
我尝试将网址更改为"http://maps.google.com/something",但它会调用Safari而不是内置的地图应用.我注意到变量正在正确传递给URL.
有任何想法吗?
提前致谢!
我真的很难处理Ramda中不同级别的任务.我正在尝试构建一个脚本来解析LESS文件以获取注释,并从注释中的数据和示例文件中的内联HTML构建模式库站点.除了内联示例文件内容之外,它都在工作(有很多SO的帮助).
const target = path.join(__dirname, 'app/dist/templates/');
const source = path.join(__dirname, 'source/');
const stylesSource = path.join(__dirname, 'source/less/');
const template = path.join(__dirname, 'app/src/templates/page-template.html');
const writeTemplate = function(data) {
var rs = fs.createReadStream(template);
var ws = fs.createWriteStream(path.join(target, R.toLower(R.concat(data.name, ".html"))));
rs
.pipe(replaceStream("{{name}}", data.name))
.pipe(replaceStream("{{description}}", data.description))
.pipe(replaceStream("{{example}}", data.example))
.pipe(ws);
}
const inlineExample = function(data) {
return readFile(path.join(source, data.example));
}
// parseFile :: String -> { name :: String
// , description :: String
// , example :: String }
const parseFile = function parseFile(data) { …
Run Code Online (Sandbox Code Playgroud) 所以对于我的罪,我正在进行Angular 2项目.我angular.element($0).scope()
一直在使用旧的Angular 1工作来检查元素,并在开发工具中查看范围内的内容.这非常有用,Angular 2中有类似的东西吗?
我一直在玩space
和的round
价值观background-repeat
。从理论上讲,这应该意味着我可以使用径向渐变在元素上创建漂亮的虚线边框,而不会将这些点切除。
.test {
background-repeat: space no-repeat;
background-size: 20px 10px;
background-image: radial-gradient(circle closest-side, red calc(100% - 1px), transparent 100%);
transition: background-image 0.5s linear;
padding-bottom: 10px !important;
background-position: left top;
resize: both;
overflow: auto;
border: 2px solid;
padding: 20px;
width: 310px;
}
Run Code Online (Sandbox Code Playgroud)
https://jsbin.com/momiwokena/1/edit?css,输出
它在Chrome浏览器中可以很好地工作,但是在Safari中,一旦元素变得太宽,它就会停止工作,并在右侧切割掉点。
我怎样才能使Safari不至于断点?
编辑:这已与苹果公司提出。
ios6-maps ×4
ios5 ×3
ios6 ×3
javascript ×3
angular ×2
folktale ×2
ios ×2
mapkit ×2
ramda.js ×2
angularjs ×1
chrome-ios ×1
css ×1
directions ×1
fantasyland ×1
future ×1
google-maps ×1
iphone ×1
memory ×1
mkmapview ×1
objective-c ×1
safari ×1