最近我正在开发Xamarin 360度显示的视频和图像,现在已经导入到库中,正好在程序内部进行panowidget。布局设置如此
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent">
<com.google.vr.sdk.widgets.pano.VrPanoramaView
android:id="@+id/pano_view"
android:layout_width="match_parent"
android:layout_height="250dp">
</com.google.vr.sdk.widgets.pano.VrPanoramaView>
</LinearLayout>
虽然主要活动看起来像这样
using Android.App;
using Android.OS;
using Google.VR.SDK.Widgets.Pano;
using Android.Graphics;
namespace App10
{
[Activity(Label = "App10", MainLauncher = true, Icon = "@drawable/icon")]
public class MainActivity : Activity
{
VrPanoramaView.Options options = new VrPanoramaView.Options();
protected override void OnCreate(Bundle bundle)
{
base.OnCreate(bundle);
SetContentView(Resource.Layout.Main);
VrPanoramaView panoramaView = FindViewById<VrPanoramaView>(Resource.Id.pano_view);
options.InputType = VrPanoramaView.Options.TypeMono;
Bitmap myBitmap = BitmapFactory.DecodeFile("/Resources/drawable/testRoom1_2kMono.jpg");
panoramaView.LoadImageFromBitmap(myBitmap, options);
// Set our view from the "main" layout resource
// SetContentView (Resource.Layout.Main);
}
}
}
当我填写执行时,我得到了这些运行时错误
#1: Binary XML file line #1: Error inflating class com.google.vr.sdk.widgets.pano.VrPanoramaView
有关于这个愚蠢问题的解决方案吗?