关于标题,我是Android的初学者。当运行github的sceneform-sample时,我发现当模型出现在屏幕上时,模型下面会出现一个白色圆圈。我可以使用哪些方法去除底部的白色圆圈?
我上传了一张图片,以便您可以更直观地理解我的问题。
答案 0 :(得分:0)
只需不打node.select()
,就可以了。
答案 1 :(得分:0)
我认为您可能已经在 GitHub 中找到了您问题的答案,但为了完整起见,这里有一些 Kotlin 中的示例,设置 SelectionVisualiser,它允许您确定在选定的 TransformableNode 下显示或不显示什么。
示例 1
更改整个活动的 SelectionVisualiser:
class StartViewMainActivity : AppCompatActivity() {
//included in the class variables
private lateinit var defaultSelectionVisualiser:SelectionVisualizer
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
//As part of OnCreate, set the selection visualiser
arFragment.transformationSystem.selectionVisualizer = CustomSelectionVisualiser()
}
private class CustomSelectionVisualiser(): SelectionVisualizer {
//Class providing a custom TransformableNode SelectionVisualiser
//This particular custom visualiser shows no image
override fun applySelectionVisual(node:BaseTransformableNode){}
override fun removeSelectionVisual(node:BaseTransformableNode){}
}
}
示例 2
在程序流的一部分期间以编程方式更改 SelectionVisualiser:
class StartViewMainActivity : AppCompatActivity() {
//included in the class variables
private lateinit var defaultSelectionVisualiser:SelectionVisualizer
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
//As part of OnCreate, get the default selection visualiser
defaultSelectionVisualiser = arFragment.transformationSystem.selectionVisualizer
}
fun toggelSelectionVisulaisers() {
//Switch between the default and the custom selectionVisualisers
if (arFragment.transformationSystem.selectionVisualizer == defaultSelectionVisualiser) {
arFragment.transformationSystem.selectionVisualizer = CustomSelectionVisualiser) else
} else {
arFragment.transformationSystem.selectionVisualizer = defaultSelectionVisualiser arFragment.transformationSystem.selectionVisualizer = CustomSelectionVisualiser) else
}
private class CustomSelectionVisualiser(): SelectionVisualizer {
//Class providing a custom TransformableNode SelectionVisualiser
//This particular custom visualiser shows no image
override fun applySelectionVisual(node:BaseTransformableNode){}
override fun removeSelectionVisual(node:BaseTransformableNode){}
}
}