【发布时间】:2014-07-03 20:46:04
【问题描述】:
我正在尝试制作一个我不知道如何修复它的设计。我想要的是制作类似于这个的东西:http://i57.tinypic.com/2v8n5z9.jpg
我尝试了一些东西(相对布局),但没有解决我的问题。有人可以解释我该怎么做吗?
到目前为止我有这个,但它不像我想要的那样。
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@drawable/content_bg" >
<include
android:id="@+id/include2"
layout="@layout/header" />
<include
android:id="@+id/include1"
layout="@layout/footer" />
<SeekBar
android:id="@+id/Seekbar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_above="@+id/include1"
android:layout_marginBottom="30dp"
android:layout_marginLeft="50dp"
android:layout_marginRight="50dp"
android:max="100" />
<ImageView
android:id="@+id/imageView1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_above="@+id/Seekbar"
android:layout_centerHorizontal="true"
android:layout_marginBottom="40dp"
android:src="@drawable/play_start" />
</RelativeLayout>
编辑,我自己修好了
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@drawable/content_bg" >
<include
android:id="@+id/include2"
layout="@layout/header" />
<include
android:id="@+id/include1"
layout="@layout/footer" />
<SeekBar
android:id="@+id/Seekbar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_above="@+id/include1"
android:layout_marginBottom="30dp"
android:layout_marginLeft="50dp"
android:layout_marginRight="50dp"
android:layout_marginTop="10dp"
android:max="100" />
<ImageView
android:id="@+id/imageView1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_above="@+id/Seekbar"
android:layout_centerHorizontal="true"
android:src="@drawable/play_start" />
<RelativeLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_above="@+id/imageView1"
android:layout_alignParentLeft="true"
android:layout_below="@+id/include2"
android:layout_marginBottom="50dp" >
<RelativeLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_alignParentTop="true"
android:layout_marginLeft="50dp"
android:layout_marginRight="50dp"
android:layout_marginBottom="100dp">
<ImageView
android:id="@+id/imageView2"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_alignParentBottom="true"
android:layout_alignParentLeft="true"
android:layout_alignParentRight="true"
android:layout_alignParentTop="true"
android:scaleType="fitStart"
android:src="@drawable/logo" />
</RelativeLayout>
</RelativeLayout>
【问题讨论】:
标签: android xml android-relativelayout