【问题标题】:How to display Video in full screen width如何以全屏宽度显示视频
【发布时间】:2016-05-03 11:24:11
【问题描述】:

如何全屏显示视频。

   <LinearLayout
                   android:layout_width="fill_parent"
                   android:layout_height="wrap_content">

                   <VideoView
                       android:layout_width="fill_parent"
                       android:layout_height="200dp"
                       android:id="@+id/video_view"
                       android:layout_alignParentLeft="true"
                       android:layout_alignParentRight="true"
                       android:layout_gravity="center"

                       />

               </LinearLayout>

这是附图

【问题讨论】:

  • android:layout_alignParentLeft="true" 出现在 RelativeLayout 中!不在线性布局中
  • 如果你能上传所有的布局xml文件会很有帮助
  • 感谢问题已解决

标签: android shell android-layout listview


【解决方案1】:

使用相对布局

   <RelativeLayout
                   android:layout_width="fill_parent"
                   android:layout_height="wrap_content">

                   <VideoView
                       android:layout_width="fill_parent"
                       android:layout_height="200dp"
                       android:id="@+id/video_view"
                       android:layout_alignParentLeft="true"
                       android:layout_alignParentRight="true"
                       android:layout_gravity="center"

                       />

               </RelativeLayout>

【讨论】:

    【解决方案2】:

    在Android mainifist文件中添加屏幕方向横向并放入

    android:layout_height="200dp"
    

    android:layout_height="fill_parent"
    

    并将父级设为 RelativeLayout

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2019-09-06
      • 1970-01-01
      • 2020-09-24
      • 1970-01-01
      • 2014-08-11
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多