草庐IT

translation-unit

全部标签

html - 检测 'transform: translate3d' 支持

有谁知道我将如何检测transform:translate3d(x,y,z)支持是否可用?我的问题是我想在支持它的浏览器中使用translate3d,因为它倾向于使用硬件加速,因此动画更流畅,然后回退到translate哪里不是。 最佳答案 查看thissolution.它是基于这样一个事实,即如果浏览器支持转换,的值window.getComputedStyle(el).getPropertyValue('transform')将是包含变换矩阵的字符串,当对元素el应用3d变换时。否则,它将是undefined或字符串'none'

html - 什么是 -webkit-transform : translate3d(0, 0,0);到底做什么?适用于 body ?

-webkit-transform:translate3d(0,0,0);究竟是做什么的?它有任何性能问题吗?我应该只将它应用于body或个别元素吗?它似乎大大改善了滚动事件。谢谢你的教训! 最佳答案 -webkit-transform:translate3d(0,0,0);让一些设备运行它们的硬件加速。找到一本好书HereNativeapplicationscanaccessthedevice’sgraphicalprocessingunit(GPU)tomakepixelsfly.Webapplications,ontheoth

IOS 7 CollectionViewFlowLayout 3D Translation(像新的 Safari Tabviewer)

我的问题我想用看起来像SafariPageviewer的CollectionViewFlowLayout实现一个CollectionView(见截图)由于Apple引用了诸如“z-index”和“Transformations”之类的东西,因此很容易实现。经过几天的教程和研究后,我无法做到。我遵循了一些普通的CollectionViewFlowLayout并使其成为CollectionViewFlowLayout的子类。现在我尝试了-(NSArray*)layoutAttributesForElementsInRect:(CGRect)rect-(void)modifyLayoutAt

ios - Xcode 5 : Unit Tests not running

我创建了一些测试用例,它们都通过了...那是因为它们没有运行。从Xcode,我得到:TestSuite'Alltests'startedat...TestSuite'Alltests'finishedat...Executed0tests,with0failures(0unexpected)in0.00secondsTheproject(andunittestclasses)buildsuccessfully.AllmytestclasseshaveMyApp_appTestsasTargetMembershipselected.ProductionclasseshaveMyApp_a

ios - ios中区域为 "United Kingdom"时如何获取系统时间格式?

我正在使用以下代码在ios中获取系统时间格式。当我当前的区域设置为“美国”时,它工作正常,但当我将区域从“美国”更改为“英国”时,它总是提供12小时的合成时间。#pragmamark#pragmamark-getsystemtime-(BOOL)getSystemTimeFormat{NSString*strDateFormate=@"hha";NSString*dateFormat=[NSDateFormatterdateFormatFromTemplate:strDateFormateoptions:0locale:[NSLocalecurrentLocale]];if([date

ios - Xcode复选框在哪里 "Translates Autoresizing Mask Into Constraints"

在WWDC2012视频之一“AutoLayoutByExample”中,他们演示了一个使用Autolayout的OSX应用程序,在大约7或8分钟的时间里,他展示了如何在单个View中取消选中属性中的框Inspector,该框的名称类似于“将自动调整掩码转换为约束”。现在,我很清楚这个框的等效代码,translatesAutoresizingMaskIntoConstraintsbool值,但我似乎无法在iOS或OSX项目的任何地方找到这个复选框。我的项目使用自动布局。我真的很喜欢这个复选框,因为我在学习Autolayout(以及将springs/struts应用程序转换为AL)的过程中

ios - XCode 获取 "target specifies product type ' com.apple.product-type.bundle.unit-test',但 'iphoneos' 平台没有此类产品类型”

在XCode中运行我的项目时,我的测试给出了这个错误:targetspecifiesproducttype'com.apple.product-type.bundle.unit-test',butthere'snosuchproducttypeforthe'iphoneos'platform它发生在几次XCode更新之后。有谁知道如何解决这个问题? 最佳答案 看起来Xcode6将ocunit测试包的产品标识符从com.apple.product-type.bundle更改为com.apple.product-type.bundle.

unit-testing - 使用相同的参数链接多个调用以返回不同的结果

我正在编写一个包含大量单元测试的Flutter应用程序。我正在使用Mockito模拟我的类(class)。来自Java(Android)世界,我可以在其中使用Mockito链接调用以在后续调用中返回不同的值。我希望这能奏效。import'package:test/test.dart';import'package:mockito/mockito.dart';voidmain(){test("somestringtest",(){StringProviderstrProvider=MockStringProvider();when(strProvider.randomStr()).the

unit-testing - 在 Dart 中测试包含异步函数的函数

我想测试一个调用其他异步函数的函数,但我不知道如何编写它。函数会像这样:function(Xx,Yy){x.doSomethingAsync().then((result){if(result!=null){y.doSomething();}}}我想同时模拟X和Y,运行X,然后验证是否调用了y.doSomething()。但是我不知道如何等待x.doSomethingAsync()完成。我正在考虑在断言之前做一些等待,但它似乎不是可靠的解决方案。有什么帮助吗?:) 最佳答案 您可以在dart中使用async/await。这会大大简化

unit-testing - flutter 单元测试。运行测试时出错

我在运行flutter单元测试时遇到以下错误。00:05+1:.../home/kazekage/Projects/flutter/flutter_woocommerce/test/model/util/Refund_test.dartShell:[ERROR:flutter/shell/common/shell.cc(184)]DartError:error:importofdart:mirrorswith--enable-mirrors=falseShell:[ERROR:flutter/shell/common/engine.cc(175)]Couldnotpreparetoru