【发布时间】:2019-01-28 14:40:51
【问题描述】:
我正在尝试在 ARCore 中显示 2D PNG 图像,但没有显示任何内容。 当我尝试使用 ModelRenderable 进行渲染时,3D 对象的渲染效果很好。因此,在尝试使用 ViewRenderable 渲染图像时,我做错了。
这里是与渲染有关的代码:在下面的代码中,我收到错误/警告,'imageView' is never used.
ViewRenderable.builder()
.setView(context, R.layout.imgboard)
.build()
.thenAccept(renderable -> {
ImageView imageView = (ImageView) renderable.getView();
});
这是 XML 文件:
<?xml version="1.0" encoding="utf-8"?>
<ImageView xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/imageCard"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@drawable/qbf"
android:adjustViewBounds="true"
android:scaleType="centerInside"/>
【问题讨论】: