I am trying to display a 2D PNG image in ARCore, but nothing is being displayed. The rendering of a 3D object works perfectly when I try to render using ModelRenderable. So there is something I am doing wrong when trying to render an image using ViewRenderable.
Here is the code pertaining to the rendering: In the below code, I get the error/warning, 'imageView' is never used.
ViewRenderable.builder()
.setView(context, R.layout.imgboard)
.build()
.thenAccept(renderable -> {
ImageView imageView = (ImageView) renderable.getView();
});
Here is the XML file:
<?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"/>