-1

I have a horizontal scrolling view pager. I set child items width to match_parent. But im getting them wrap_content instead. This view should be centred by gravity but parent's FrameLayout is cropped to child's width Items code:

<FrameLayout 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">

    <com.google.android.exoplayer2.ui.PlayerView
        android:id="@+id/exo_player"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_gravity="center"
        app:use_controller="false" />

    <ImageView
        android:id="@+id/sound"
        android:layout_width="26dp"
        android:layout_height="26dp"
        android:layout_gravity="bottom|right"
        android:layout_margin="13dp"
        android:src="@drawable/icon_sound_off_active" />
</FrameLayout>

This view should be centred

Vadim Kotov
  • 8,084
  • 8
  • 48
  • 62
Kostya1375
  • 99
  • 6

1 Answers1

0

I think the issue might be related to the resolution of the video you being played, rather than the view matching its parent's width.

cesards
  • 15,882
  • 11
  • 70
  • 65