我正在寻找一个解决方案来为swift中的文件添加扩展文件属性.我查了这个链接写扩展文件属性,但解决方案是客观的c,我需要一个swift的解决方案.
我正在尝试进行过滤查询:
public Cursor runQuery(CharSequence constraint) {
return getActivity().getContentResolver().query(
Phone.CONTENT_URI,
new String[] {Phone.DISPLAY_NAME, Phone.NUMBER, Phone.TYPE, Phone._ID },
Phone.DISPLAY_NAME + " LIKE '" + constraint + "%'",// <-- problem here
null,
Phone.DISPLAY_NAME);
}
Run Code Online (Sandbox Code Playgroud)
但LIKE运算符对于非ascii字符以区分大小写的方式工作(如SQLite文档所述).有没有办法让案例不敏感的LIKE?(ps我测试俄罗斯符号)
不起作用的事情:
需要帮助或建议.谢谢.
我正在使用以下代码使用平移手势旋转节点。我喜欢只在 y 轴上旋转我的节点。
let translation = gestureRecognize.translation(in: gestureRecognize.view!)
let x = Float(translation.x)
let y = Float(-translation.y)
let anglePan = (sqrt(pow(x,2)+pow(y,2)))*(Float)(Double.pi)/180.0
var rotationVector = SCNVector4()
rotationVector.x = 0.0
rotationVector.y = x
rotationVector.z = 0.0
rotationVector.w = anglePan
node.rotation = rotationVector
if(gestureRecognize.state == UIGestureRecognizerState.ended) {
let currentPivot = node.pivot
let changePivot = SCNMatrix4Invert( node.transform)
node.pivot = SCNMatrix4Mult(changePivot, currentPivot)
node.transform = SCNMatrix4Identity
}
Run Code Online (Sandbox Code Playgroud)
这适用于 Euler 设置为 (x: 0, y: 0, z: 0) 的节点。但是我的节点有 Euler (x: -90, y: 0, z: 0)。对于我的欧拉值,上面的代码以错误的角度旋转对象。如何使用我的/不同的 Euler 值旋转节点?
我有一个ListView内心ScrollView.我可以启用滚动ListView通过
listView.getParent().requestDisallowInterCeptTouchEvent(true);
Run Code Online (Sandbox Code Playgroud)
但问题是当我在listView中向上滚动并且它到达顶部时它应该滚动到父视图,即父滚动必须工作.我怎样才能做到这一点 ?任何建议请.