Camera 2 APIを使用するアプリケーションを開発しようとしていますが、ボトムバーの高さを編集しようとすると問題が発生します。私はカメラとボトムバーの間の黒いスペースを取り除きたいと思います。また、カメラの高さを伸ばしたいと思います。Android Camera2 - カメラとボトムバーの間の黒いスペースを削除する
Google Camera2Basicの例に従っています。
私はこの問題を解決できますか?
ありがとうございました。
activity_camera.xml
<?xml version="1.0" encoding="utf-8"?>
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/container"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#000"
tools:context=".CameraActivity" />
fragment_camera2.xml
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:foreground="?selectableItemBackground" >
<widgets.AutoFitTextureView
android:id="@+id/texture"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true"
android:layout_alignParentTop="true" />
<FrameLayout
android:id="@+id/control"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true"
android:elevation="4dp"
android:paddingBottom="12dp"
android:paddingLeft="16dp"
android:paddingRight="16dp"
android:paddingTop="12dp"
android:background="@color/white" >
<ImageButton
android:id="@+id/picture"
android:layout_width="@dimen/ic_camera"
android:layout_height="@dimen/ic_camera"
android:layout_gravity="center"
android:background="@drawable/cam_circle_selector"
android:contentDescription="@string/description_info"
android:scaleType="fitXY"
app:srcCompat="@drawable/ic_action_capture" />
</FrameLayout>
</RelativeLayout>
xmlコードを入力してください。 –
私はちょうどXMLコードを追加しました。 – BigNick
FrameLayout内のpadding_topを調整してください –