Hi,
I have a fragment which shows textureview in part of the fragment like in the following code -
Issue is when running the app I get the camera preview squized like in the followin image-
How can I resize the textureview to show the camera image correctly ?
I have a fragment which shows textureview in part of the fragment like in the following code -
Code:
<?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:layout_width="match_parent"
android:layout_height="match_parent"
android:eek:rientation="vertical"
tools:context=".teud">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="1"
android:background="@drawable/detailsback"
android:eek:rientation="vertical">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:id="@+id/textureHost"
android:layout_weight="1"
android:eek:rientation="horizontal">
<TextureView
android:id="@+id/textureView"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="1" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="5"
android:eek:rientation="horizontal">
<Button
android:id="@+id/button3"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="Button" />
</LinearLayout>
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="2"
android:background="@drawable/detailsback"
android:eek:rientation="vertical"></LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="2"
android:background="@drawable/detailsback"
android:eek:rientation="vertical"></LinearLayout>
</LinearLayout>
Issue is when running the app I get the camera preview squized like in the followin image-
How can I resize the textureview to show the camera image correctly ?
Last edited by a moderator: