繁体   English   中英

Android VideoView黑色栏出现在底部

[英]Android VideoView Black bar appearing at bottom

我有一个videoview来播放视频,然后在该布局中还有其他按钮。但是视频的黑条出现在布局的底部。我应该怎么做才能在videoview的底部制作黑条。

    <?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:background="@color/White" >

    <RelativeLayout
        android:id="@+id/first_intro"
        android:layout_width="fill_parent"
        android:layout_height="fill_parent"
        android:layout_marginBottom="10dp"
        android:layout_marginLeft="14dp"
        android:layout_marginRight="14dp"
        android:layout_marginTop="14dp"
        android:background="@color/intro2_bg"
        android:padding="@dimen/sidearea_padding" >

        <Button
            android:id="@+id/remove_page_from_introthird"
            android:layout_width="15dp"
            android:layout_height="15dp"
            android:layout_alignParentRight="true"
            android:layout_marginTop="5dp"
            android:background="@drawable/cross" />

        <LinearLayout
            android:layout_width="match_parent"
            android:layout_height="fill_parent"
            android:layout_above="@+id/footer_btns_layout_linear"
            android:layout_centerInParent="true"
            android:layout_marginBottom="20dp" >

            <VideoView
                android:id="@+id/videoView_introthree"
                android:layout_width="match_parent"
                android:layout_height="fill_parent"
                android:layout_gravity="center_vertical"
                android:background="@android:color/transparent" />
        </LinearLayout>

        <LinearLayout
            android:id="@+id/footer_btns_layout_linear"
            android:layout_width="fill_parent"
            android:layout_height="wrap_content"
            android:layout_alignParentBottom="true"
            android:orientation="horizontal"
            android:weightSum="1" >

            <Button
                android:id="@+id/prev_btn2"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_marginBottom="8dp"
                android:layout_marginRight="8dp"
                android:layout_weight="0.5"
                android:background="@drawable/previous_selecter" />

            <Button
                android:id="@+id/nxt_btn2"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_marginBottom="8dp"
                android:layout_marginLeft="8dp"
                android:layout_weight="0.5"
                android:background="@drawable/get_start_selecter" />
        </LinearLayout>
    </RelativeLayout>

</RelativeLayout>

尝试这个 :

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical" >

<LinearLayout
    android:layout_width="fill_parent"
    android:layout_height="wrap_content"
    android:layout_gravity="center"
    android:gravity="center"
    android:orientation="vertical"
    android:padding="5dip" >

    <Button
        android:id="@+id/mSDCardbutton"
        android:layout_width="fill_parent"
        android:layout_height="match_parent"
        android:text="@string/play_sdcard" />

    <Button
        android:id="@+id/mServerbutton"
        android:layout_width="fill_parent"
        android:layout_height="match_parent"
        android:text="@string/play_server" />

    <Button
        android:id="@+id/mRawbutton"
        android:layout_width="fill_parent"
        android:layout_height="match_parent"
        android:text="@string/play_raw" />
</LinearLayout>

<Button
    android:id="@+id/mbutton"
    android:layout_width="fill_parent"
    android:layout_height="wrap_content"
    android:text="@string/button" />

<VideoView
    android:id="@+id/VideoView"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:layout_gravity="center" />

</LinearLayout>

在此布局中,按钮位于顶部。您可以将其保持在底部。 希望这可以帮助。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM