我的数据库,表格,字段都使用utf8mb4.我可以将表情符号存储在某些字段中.现在我尝试查询如下:
SELECT*FROM userWHERE name =''
令人惊讶的是,结果是具有不同字段名称的记录,例如''
看起来mysql按照它们的长度而不是内容来匹配表情符号字符串.
有什么想法解决这个问题吗?非常感谢.
我试图在下面的代码中使文本字符串(SCNText)适合框(SCNBox).框的大小看起来正确,但文本不在框的右侧中心.任何想法或解决方案?谢谢
let geoText = SCNText(string: "Hello", extrusionDepth: 1.0)
geoText.font = UIFont (name: "Arial", size: 8)
geoText.firstMaterial!.diffuse.contents = UIColor.red
let textNode = SCNNode(geometry: geoText)
let (minVec, maxVec) = textNode.boundingBox
scnScene.rootNode.addChildNode(textNode)
let w = CGFloat(maxVec.x - minVec.x)
let h = CGFloat(maxVec.y - minVec.y)
let d = CGFloat(maxVec.z - minVec.z)
let geoBox = SCNBox(width: w, height: h, length: d, chamferRadius: 0)
geoBox.firstMaterial!.diffuse.contents = UIColor.green.withAlphaComponent(0.5)
scnScene.rootNode.addChildNode(boxNode)
Run Code Online (Sandbox Code Playgroud)
编辑:我添加了一个新的字符串图像(没有SCNBox节点)与debugOptions showBoundingBoxes看到它的边界框
解决方案1:
从vdugnist的回答中,我为任何想要测试的人创建了一个游乐场代码:
import UIKit
import SceneKit
import PlaygroundSupport
var sceneView = SCNView(frame: CGRect(x: 0, y: …Run Code Online (Sandbox Code Playgroud)