开发者

Problem on aligning VideoView along with linearLayout

开发者 https://www.devze.com 2023-03-25 20:45 出处:网络
I need to design a layout as same as in the following given picture below. And I have tried it by taking three linearlayout, in the first linearlayout I have to add a image as \"header\", second as Vi

I need to design a layout as same as in the following given picture below. And I have tried it by taking three linearlayout, in the first linearlayout I have to add a image as "header", second as VideoView and third as Footer. but the footer image doesn't get displayed in the emulator and device too. So how can I fix it Any help will really be appreciable. Thanks

IMAGE

here is the xml:

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_height="fill_parent" android:layout_width="match_parent"
    android:orientation="vertical">
    <LinearLayout android:id="@+id/linearLa开发者_C百科yout3"
        android:layout_width="match_parent" android:layout_height="wrap_content"
        android:background="@drawable/header" android:orientation="vertical"></LinearLayout>
    <LinearLayout android:id="@+id/linearLayout2"
        android:orientation="vertical" android:layout_width="match_parent"
        android:layout_height="150dp">
        <VideoView android:id="@+id/videoView1"
            android:layout_width="fill_parent" android:layout_height="wrap_content"
            android:keepScreenOn="true" android:fitsSystemWindows="true"></VideoView>
    </LinearLayout>
    <LinearLayout android:id="@+id/linearLayout1"
        android:orientation="vertical" android:layout_height="wrap_content"
        android:layout_width="match_parent" android:background="@drawable/footer"></LinearLayout>
</LinearLayout>


 <?xml version="1.0" encoding="utf-8"?>
<RelativeLayout
  xmlns:android="http://schemas.android.com/apk/res/android"
  android:layout_width="fill_parent"
  android:layout_height="fill_parent">
    <LinearLayout android:layout_height="wrap_content" android:id="@+id/linearLayout1" android:layout_width="fill_parent">
        <TextView android:id="@+id/textView1" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="HEADER"></TextView>
    </LinearLayout>
    <VideoView android:id="@+id/videoView1" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_below="@+id/linearLayout1"></VideoView>
    <LinearLayout android:layout_alignParentTop="@+id/videoView1" android:layout_alignParentBottom="true" android:layout_height="wrap_content" android:id="@+id/linearLayout2" android:layout_width="fill_parent">
        <TextView android:id="@+id/textView2" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="FOOTER"></TextView>
    </LinearLayout>
</RelativeLayout>

Try using the Relative Layout.

In this snippet you will be able to place header above video but for footer i am not sure try keeping above the video view like what the default video player does.

0

精彩评论

暂无评论...
验证码 换一张
取 消