Wednesday, 9 March 2022

How to remove black horizontal line from SurfaceView in android

Hi I have created SurfaceV in which i am playing video but in that what happen in bottom side it show horizontal line i am trying to remove it. enter image description here

we can see there is bottom horizontal black view i want to remove it i am not sure this is our UI issue or its SurfaceView Issue .

below is my layout .

<?xml version="1.0" encoding="utf-8"?>
<layout 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">

    <RelativeLayout
        android:id="@+id/rtspView"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:visibility="visible"

        >

        <SurfaceView
            android:id="@+id/surface"
            android:layout_width="match_parent"
            android:layout_height="220dp"
            android:layout_centerHorizontal="true"
            android:layout_gravity="center"
            android:background="@mipmap/ic_launcher" />


        <androidx.constraintlayout.widget.ConstraintLayout
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:layout_below="@+id/surface">

            <androidx.constraintlayout.widget.ConstraintLayout
                android:id="@+id/middleLayout"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_marginLeft="15dp"
                android:layout_marginTop="20dp"
                android:layout_marginRight="15dp"
                android:background="@drawable/ic_launcher_background"
                android:padding="10dp"
                app:layout_constraintTop_toTopOf="parent">


                <ImageView
                    android:id="@+id/recordingBtn"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:src="@drawable/ic_launcher_background"
                    app:layout_constraintBottom_toBottomOf="parent"
                    app:layout_constraintLeft_toLeftOf="parent"
                    app:layout_constraintRight_toRightOf="parent"
                    app:layout_constraintTop_toTopOf="parent" />


            </androidx.constraintlayout.widget.ConstraintLayout>


            <ImageView
                android:id="@+id/audioStatusIcon"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_marginTop="20dp"
                android:src="@drawable/ic_launcher_background"
                app:layout_constraintLeft_toLeftOf="parent"
                app:layout_constraintRight_toRightOf="parent"
                app:layout_constraintTop_toBottomOf="@+id/middleLayout" />


        </androidx.constraintlayout.widget.ConstraintLayout>

    </RelativeLayout>


</layout>

Please help me how to remove this line .



from How to remove black horizontal line from SurfaceView in android

No comments:

Post a Comment