我需要在交易中创建一个文档。事务对象没有添加功能,可能是因为它会创建多个文档以防Firestore重试事务。
我能想到的唯一方法是GUID用作文档ID,但是它们为查找提供了很长的索引。有什么办法吗?另一种方法?
看起来ConstraintSet很难应付Start/End约束。
此示例取自Google 示例。Github:android-ConstraintLayoutExamples
当你更换左和右约束Start和End,约束集-不能正常工作,它的工作与Left/Right唯一约束。
例如,将 layout_constraintStart_toStartOf 替换为 layout_constraintLeft_toLeftOf 并将 layout_constraintEnd_toEndOf 替换为 layout_constraintRight_toRightOf
在以下文件中:
constraintset_example_main.xml
constraintset_example_big.xml
点击图片:
private ConstraintSet mConstraintSetNormal = new ConstraintSet();
private ConstraintSet mConstraintSetBig = new ConstraintSet();
public void toggleMode(View v) {
TransitionManager.beginDelayedTransition(mRootLayout);
mShowBigImage = !mShowBigImage;
applyConfig();
}
private void applyConfig() {
if (mShowBigImage) {
mConstraintSetBig.applyTo(mRootLayout);
} else {
mConstraintSetNormal.applyTo(mRootLayout);
}
}
Run Code Online (Sandbox Code Playgroud)
默认情况下,Android Studio 使用start/end约束,因此我想知道根本原因和可能的修复方法。
还是这ConstrainSet本身就是一个错误?
刚刚将.NET框架升级到4.7.2后发现这个错误:
System.Web.HttpCompileException:some.cshtml(95):错误 CS0012:类型“IEnumerable<>”是在未引用的程序集中定义的。您必须添加对程序集“netstandard, Version=2.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51”的引用。
我应该在哪里添加引用?
当我尝试像这样设置起订量对象时:
mock.Setup(reader => reader.listOFs(1)).Returns(new List<IIAM_OF_Event>() { new IIAM_OF_Event() { ID = 11 } }.AsQueryable());
Run Code Online (Sandbox Code Playgroud)
它抛出
System.TypeInitializationException:“Moq.ProxyFactory”的类型初始值设定项引发异常。---
System.TypeInitializationException:“Moq.CastleProxyFactory”的类型初始值设定项引发异常。---> System.IO.FileLoadException:无法加载文件或程序集“Castle.Core,Version=4.1.0.0,Culture=neutral,PublicKeyToken=407dd0808d44fbdc”或其依赖项之一。找到的程序集的清单定义与程序集引用不匹配。(HRESULT 异常:0x80131040) ---> System.IO.FileLoadException:无法加载文件或程序集“Castle.Core,Version=4.0.0.0,Culture=neutral,PublicKeyToken=407dd0808d44fbdc”或其依赖项之一。找到的程序集的清单定义与程序集引用不匹配。(HRESULT 异常:0x80131040)
IIAM_OF_Event是一个 Linq 表。
应该用什么代替:
StaticLayout layout = new StaticLayout(text, paint, width, Alignment.ALIGN_NORMAL, mSpacingMult, mSpacingAdd, false);
Run Code Online (Sandbox Code Playgroud)
发出以下警告:
警告:已弃用StaticLayout中的[不推荐使用] StaticLayout(CharSequence,TextPaint,int,Alignment,float,float,boolean)StaticLayout layout = new StaticLayout(文本,paint,宽度,Alignment.ALIGN_NORMAL,mSpacingMult,mSpacingAdd,false);
我正在尝试创建一个自定义的SKSpriteNode,通过子类化SKSpriteNode,在这里使用swift代码:
import Foundation
import SpriteKit
class CustomNode:SKSpriteNode{
required init(coder aDecoder: NSCoder) {
fatalError("init(coder:) has not been implemented")
}
override init() {
super.init()
}
}
Run Code Online (Sandbox Code Playgroud)
当我将它添加到场景时,我遇到致命的错误:使用未实现的初始化程序'init(texture:color:size :)'用于类'Sandbox.CustomNode'
如果我改变
super.init()
Run Code Online (Sandbox Code Playgroud)
对于
super.init(texture: nil, color:UIColor.whiteColor(),size: CGRect(0,0,100,100))
Run Code Online (Sandbox Code Playgroud)
我得到了编译器错误:"调用中的额外参数'颜色'.
我正在使用XCode 6,beta 7.它是一个iOS项目.
尝试了下面的推导的许多变化但没有工作.
import Foundation
import SceneKit
class test:SCNScene{
override init(){
super.init()
}
required init(coder aDecoder: NSCoder) {
super.init(coder: aDecoder)
}
convenience init? (i:UIViewController){
self.init(named:"") //Compile Error:use of self delegating initializer before self.init is called
}
}
Run Code Online (Sandbox Code Playgroud)
根据Swift文档,初始化规则2,不应该初始化?(命名:String)方便可用的初始化器在实现2指定的初始化器后可用吗?我错了什么?
经过几次调试后,我再也无法编译项目了.
编译为一些系统程序集提供了几个访问错误,如下面的错误,所有这些都与roslyn bin文件夹有关:
错误MSB3021:无法将文件...\packages\Microsoft.Net.Compilers.2.2.0\tools\System.Collections.Immutable.dll"复制到"bin\roslyn\System.Collections.Immutable.dll".访问路径'bin\roslyn\System.Collections.Immutable.dll'被拒绝.
重启到VS无法解决.该项目使用IIS express运行,并且没有运行IIS express进程.
只有解决方案是重启.
我正在使用VS2017,更新2
我试图使用onData获取循环视图,但我陷入了这个错误:
层次结构中找不到匹配的视图:可从类中分配:class android.widget.AdapterView
代码就是这样:
onData(allOf(isAssignableFrom(RecyclerView.class), withId(R.id.ce_musers_list)))
.check(matches(withEffectiveVisibility(ViewMatchers.Visibility.VISIBLE)));
Run Code Online (Sandbox Code Playgroud)
我的适配器扩展RecyclerView.Adapter到RecycleView的应用程序,然而,匹配器正在寻找一个简单的适配器.这是我第一次使用espress,所以我可能会失败一些基本的东西.
我的Espresso版本是3.0.0
unit-testing android-espresso recycler-adapter android-recyclerview
我将旧应用程序从Swift 3迁移到Swift 4,并遇到了以下错误:
error: Multiple commands produce '/Users/.../Library/Developer/Xcode/DerivedData/ ... /Debug-iphonesimulator/CompassV3.swiftmodule/x86_64.swiftmodule':
1) Target 'CompassV3' (project 'Void Navigator'): Ditto /Users/.../Library/Developer/Xcode/DerivedData/.../Debug-iphonesimulator/CompassV3.swiftmodule/x86_64.swiftmodule /Users/.../Library/Developer/Xcode/DerivedData/Void_Navigator-bogrvoiumgmhfwcpvocwtssiwgpm/Build/Intermediates.noindex/Void Navigator.build/Debug-iphonesimulator/CompassV3.build/Objects-normal/x86_64/CompassV3.swiftmodule
2) Target 'Outdoor Navigator' (project 'Void Navigator'): Ditto /Users/.../Library/Developer/Xcode/DerivedData/.../Debug-iphonesimulator/CompassV3.swiftmodule/x86_64.swiftmodule /Users/.../Library/Developer/Xcode/DerivedData/Void_Navigator-bogrvoiumgmhfwcpvocwtssiwgpm/Build/Intermediates.noindex/Void Navigator.build/Debug-iphonesimulator/Outdoor Navigator.build/Objects-normal/x86_64/CompassV3.swiftmodule
Run Code Online (Sandbox Code Playgroud)
CompassV3 构建应用
Outdoor navigator 是扩展。
看起来像是冲突,但我不知道如何解决。
这些项目仍在快速版本3中。
swift ×3
android ×2
c# ×2
unit-testing ×2
asp.net ×1
firebase ×1
ios ×1
linq ×1
moq ×1
roslyn ×1
sprite-kit ×1
staticlayout ×1
transactions ×1
xcode ×1
xcode10.1 ×1
xcodebuild ×1