把任何浏览过的Andr​​oid的一个VideoView [英] Put any View over a VideoView in Android

查看:189
本文介绍了把任何浏览过的Andr​​oid的一个VideoView的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有可能把任何视图在一个VideoView? (即把控制按钮在视频上,像VIMEO)。我试图用的FrameLayout做到这一点,但我还没有找到办法了,我真不知道,如果我想要做的东西是根本不可能的。

It is possible to put any view over a VideoView? (I.e. put the control buttons over the video, like in vimeo). I'm trying to do it using FrameLayout, but I have not found the way, and I'm still not sure if what I'm trying to do something that's is simply not possible.

推荐答案

我做这种具有的FrameLayout的事情。你需要做的是确保该控件在PCB编辑器的VideoView下方。

I do this sort of thing with FrameLayout. What you need to do is make sure that the controls are below the VideoView in the Layout Editor.

<?xml version="1.0" encoding="utf-8"?>
<FrameLayout
    xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    android:orientation="vertical"
    android:background="@color/MenuTextNormal">

    <VideoView
        android:id="@+id/VideoView"
        android:layout_height="fill_parent"
        android:layout_width="fill_parent" />

    <LinearLayout
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:id="@+id/ControlLayout"
        android:layout_gravity="bottom|center_horizontal">

        <Button
            android:text="@+id/Button01"
            android:id="@+id/Button01"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content" />
        <Button
            android:text="@+id/Button02"
            android:id="@+id/Button02"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content" />
        <Button
            android:text="@+id/Button03"
            android:id="@+id/Button03"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content" />
        <Button
            android:text="@+id/Button04"
            android:id="@+id/Button04"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content" />
    </LinearLayout>
</FrameLayout>

这篇关于把任何浏览过的Andr​​oid的一个VideoView的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆