下面是我的活动布局XML
ngx-bootstrap
下面是我的片段布局XML,它在上述活动中显示在ViewPager中。
<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:orientation="vertical"
android:padding="0dp"
tools:context="com.hfad.bitsandpizzas.MainActivity">
<include
android:id="@+id/toolbar"
layout="@layout/toolbar_main" />
<android.support.v4.view.ViewPager xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/activity_workout_view_pager"
android:layout_width="wrap_content"
android:background="@drawable/customborder"
android:layout_height="wrap_content">
</android.support.v4.view.ViewPager>
</LinearLayout>
以上活动/片段显示youtube播放器并播放了视频1秒钟,然后在错误下方显示
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="wrap_content"
android:background="@drawable/customborder"
android:layout_height="wrap_content">
<-- youtube player will be displayed here -->
<FrameLayout
android:id="@+id/youtube_layout"
android:layout_width="220dp"
android:layout_height="220dp"
android:layout_margin="10dp"
android:background="@drawable/customborder"
android:layout_centerHorizontal="false"
/>
</LinearLayout>
据我了解,此问题与活动/片段的布局有关,不知道如何解决此问题。