このように、SurfaceViewを"#00FF0000"で指定して、TextureViewを透過させたレイアウトを作りたいのですが、画面が真っ黒になってしまいます。どうすればいいのでしょうか?
java
1<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" 2 android:layout_width="match_parent" 3 android:layout_height="match_parent"> 4 5 6 <com.example.android.camera2basic.AutoFitTextureView 7 android:id="@+id/texture" 8 android:layout_width="wrap_content" 9 android:layout_height="wrap_content" 10 android:layout_alignParentStart="true" 11 android:layout_alignParentTop="true" /> 12 13 <com.example.android.camera2basic.AnimationSurfaceView 14 android:id="@+id/surface" 15 android:layout_width="300dp" 16 android:layout_height="300dp" 17 android:background="#00FF0000" 18 /> 19
java
1 public AnimationSurfaceView(Activity context) { 2 super(context); 3 4 Log.e(TAG,"AnimationSurfaceViewのコンストラクタが呼ばれた-"); 5 surfaceHolder = getHolder(); 6 surfaceHolder.addCallback(this); 7 8 surfaceHolder.setFormat(PixelFormat.TRANSLUCENT); 9 setZOrderOnTop(true); 10 }
このように指定しているのですが、真っ黒になってしまいます。
回答1件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。