(Android Studio app) What should I do if in horizontal mode a black bar appears near the front camera? (The same thing happened in vertical mode, but after EdgeToEdge.enable(this); in vertical mode the black bar disappeared, but in horizontal mode it did not disappear)
Activity.xml
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/main"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#20f020"
tools:context=".MainActivity">
</androidx.constraintlayout.widget.ConstraintLayout>
Activity.java
package com.example.myapplication;
import android.os.Bundle;
import androidx.activity.EdgeToEdge;
import androidx.appcompat.app.AppCompatActivity;
public class MainActivity extends AppCompatActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
EdgeToEdge.enable(this);
}
}
please add some top-layout_margin like.....