我试图拉伸视频以填充视频视图。目标是创建视图,在设备中看起来像第一张图片(就像它在布局预览中看到的一样)。拉伸填充VideoView,纵横比VideoView

这个问题的大部分答案都是指this link。

我试过这个,但我仍然没有填写视频视图。

这是我的布局代码:

android:layout_width="match_parent"

android:layout_height="match_parent"

android:orientation="vertical"

android:background="@drawable/search_gren_screen">

android:layout_width="match_parent"

android:layout_height="wrap_content"

android:orientation="horizontal" >

android:id="@+id/go_back"

android:layout_width="match_parent"

android:layout_height="match_parent"

android:layout_gravity="center"

android:layout_weight="1"

android:onClick="onclick"

android:text="Try again" />

android:id="@+id/back_to_pick_song"

android:layout_width="match_parent"

android:layout_height="match_parent"

android:layout_weight="1"

android:text="Select another song"

android:onClick="onclick" />

android:id="@+id/btn_continue"

android:layout_width="match_parent"

android:layout_height="wrap_content"

android:layout_gravity="center"

android:layout_weight="1"

android:onClick="onclick"

android:text="Amazing, continue!" />

android:layout_width="fill_parent"

android:layout_height="fill_parent">

android:id="@+id/videoView1"

android:layout_width="fill_parent"

android:layout_height="fill_parent"

android:layout_alignParentBottom="true"

android:layout_alignParentLeft="true"

android:layout_alignParentRight="true"

android:layout_alignParentTop="true"

android:layout_gravity="center" />

这里有我的声明布局的预览:

然而,在设备上的结果是不同的:

2013-04-24

idan

+0

您的布局代码可以满足您的需求。但请记住,VideoView将相对于其中播放的视频缩小/伸展。 –

2013-04-24 12:11:46

+0

好的,所以我需要改变媒体记录器的宽高比来表示增加mMediaRecorder.setVideoSize(640,480);我尝试这个,它不工作...? –

2013-04-24 12:27:34

+0

检查这个答案http://stackoverflow.com/a/38971707/1153703 –

2016-08-16 09:52:15

android videoview 拉伸,拉伸填充VideoView,纵横比VideoView相关推荐

  1. Android高级控件(四)——VideoView 实现引导页播放视频欢迎效果,超级简单却十分的炫酷

    Android高级控件(四)--VideoView 实现引导页播放视频欢迎效果,超级简单却十分的炫酷 是不是感觉QQ空间什么的每次新版本更新那炫炫的引导页就特别的激动,哈哈,其实他实现起来真的很简单很 ...

  2. android自定义videoview,android-如何在播放前在videoview中设置预览图像

    android-如何在播放前在videoview中设置预览图像 我在活动中创建了VideoView,下面是代码. VideoView vvVideos = (VideoView) rootView.f ...

  3. eclipse中自定义videoview类_android控件之VideoView建立自己的播放器

    简介 用来播放视频文件.该VideoView类可以加载各种来源的图像(如资源或内容提供商),需要计算它从视频测量,以便它可以在任何布局管理器使用,并提供诸如缩放和着色的各种显示选项.在其他的平台上面可 ...

  4. android webview 填充,从Android使用WebView自动填充表格

    我正在使用WebView尝试使用我发送的数据填充表单.从Android使用WebView自动填充表格 WebView webView; String url = "http://139.59 ...

  5. android按钮周围阴影,Android 上的按钮填充和阴影

    Android 上的按钮填充和阴影Button Padding and Shadows on Android 07/10/2018 本文内容 此 Android 平台特定控制按钮是否 :::no-lo ...

  6. android百度地图行政区填充颜色

    android百度地图行政区填充颜色 给行政区填充颜色其实就是添加几何图形覆盖物,需要行政区边界上面的点的集合这样可以添加几何图形覆盖物,原理就是这样的.这是百度地图添加几何图形覆盖物网址 --htt ...

  7. android 实现视频播放功能,android开发之简单视频播放器(VideoView)

    简单视频播放器的使用 一.简单使用videoView和MediaController实现播放控制 1.添加需要的权限 2.设置布局 android:id="@+id/main_video&q ...

  8. Android中关于ScrollView中有视频播放器VideoView时问题的总结

    1.横竖屏切换问题 问题描述: 网上很多封装的视频播放器,也有横竖屏切换,但是发现在Scrollview中时横屏的高度会无效,因为Scrollview是可滚动控件 解决方案: 1)在切换前记录原始播放 ...

  9. android 图片自动拉伸,解决关于ImageView自适应的问题(拉伸变形,图片模糊)

    今天接手一个项目发现有个地方的图片显示非常小,而且还不够清晰,也没办法自适应屏幕的显示,非常的影响美观,于是 就像这优化一下. 先看看优化前的效果和优化后的效果. 修复后 修复前 布局文件修复前: 修 ...

最新文章

  1. Matplotlib三维绘图,这一篇就够了
  2. 题目2:隐式图的搜索问题(A*算法解决八数码)
  3. 运营推广人员黑话,小心躺枪!
  4. OpenGL ES 3.2
  5. 一个web图片热点生成工具(winform开发) 附源码
  6. 操作系统直接决定了计算机系统的整体性能
  7. matlab灰度分段线性变换优缺点,matlab分段线性变换
  8. 未能将“C:\Program Files (x86)\DevExpress 2009.2\Components\Sources\DevExpress.DLL\DevExpress.XtraGrid.v
  9. java发微信字体颜色_java微信公众号发送消息模板
  10. linux虚拟ip secondary ip primary ip;scope global secondary eth0 zuoxudong ;veth
  11. 影响手机成像质量的因素
  12. wifi6 feature 详解
  13. 利用 eutils 实现自动下载序列文件(python实现)
  14. OpenCV ERROE **: 02:07:27.741:GTK+ 2.x symbols detected. Using GTK+ 2.x and GTK+ 3 in the ...
  15. 2014年多益网络春季校园招聘机试题
  16. Windows下安装CMake教程
  17. VUE简易图形验证码
  18. Python主要用来做什么 它的应用大全有哪些
  19. 用 Python 做数学建模
  20. 3 .前端性能优化-使用Lighthouse测试性能

热门文章

  1. 契约测试(Pact)
  2. DBR、FAT、FDT定位及FAT结构分析
  3. sublime3调试Python
  4. python爬虫实现获取豆瓣图书的top250的信息-beautifulsoup实现
  5. 仓储搬运机器人_仓储应用机器人搬运机器人所具有的优点
  6. JAVA计算机毕业设计商品限时秒杀系统(附源码、数据库)
  7. mybatis的mapper.java_浅谈Mybatis通用Mapper使用方法_java - JAVA
  8. godaddy域名空间购买波折
  9. 透明计算不与云计算抢饭碗
  10. 学计算机用什么输入语法最好,怎么才能有效的学好电脑打字