在 VideoView 之上的 TextView 背景无法设置

发布于 2021-11-21 14:52:28 字数 1073 浏览 809 评论 1

我在一个layout中使用了一个 TextView 和 VideoView ,XML代码如下:

<?xml version="1.0" encoding="utf-8"?>
<merge xmlns:android="http://schemas.android.com/apk/res/android"
 android:orientation="vertical"
 android:layout_width="fill_parent"
 android:layout_height="fill_parent"
 android:gravity="center_vertical|center_horizontal">

<VideoView
    android:id="@+id/vView"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:layout_gravity="center_vertical|center_horizontal"
/>
<TextView
    android:id="@+id/txtNote"
    android:layout_width="fill_parent"
    android:layout_height="wrap_content"
    android:layout_gravity="top"
    android:gravity="center"
    android:layout_marginTop="100px"        
    android:textSize="30sp"
    android:textStyle="bold"
    android:background="#A000"
    android:textColor="#ffff"
/>

</merge>

我给 TextBox 设置一个 "android:background="#A000"" 属性,但不起作用。但是当我把 VideoView 改成 ImageView 的时候就没问题,请问这大概是什么情况呢?多谢了

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

落墨 2021-11-23 00:38:56

加个android:layout_weight试试  两个都加  数值相等

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文