TextView background not appearing when on top of a VideoView
I am using the merge layout to have my TextView appear on top of my VideoView. Here is my code:
<?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="fi开发者_JAVA百科ll_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>
I have placed a "android:background="#A000"" property on my TextBox, but still it won't appear. All that appears is the white text with transparent background. When I changed the VideoView to an ImageView, the TextView background appears. I wonder why the TextView background would appear on top of an ImageView but not on top of a VideoView. Any suggestions will be a great help. Thanks.
I don't know about merge, but I think, LinearLayout should do it...
精彩评论