【发布时间】:2014-08-05 16:45:55
【问题描述】:
我正在开发 MP3 播放器,但我刚刚意识到我的 main_activity.xml 搞砸了
我有 3 个按钮,上一个、播放/暂停和下一个,如图所示 here
我只有 1 个声望点,所以暂时不上传图片。
这是 XML:
<?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:id="@+id/layout"
android:layout_width="fill_parent"
android:layout_height="fill_parent" >
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_alignParentLeft="true"
android:layout_alignParentTop="true"
android:orientation="vertical"
android:weightSum="7"
tools:ignore="UselessParent" >
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="0dip"
android:layout_weight="6"
android:orientation="vertical" >
<ImageView
android:id="@+id/bg"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:contentDescription="@string/Caratula" >
</ImageView>
</LinearLayout>
<LinearLayout
android:id="@+id/buttons"
android:layout_width="fill_parent"
android:layout_height="0dip"
android:layout_weight="1"
android:background="#FFFFFF"
android:gravity="center"
android:orientation="horizontal"
android:weightSum="5" >
<Button
android:id="@+id/btnPrevious"
android:layout_width="wrap_content"
android:layout_height="fill_parent"
android:layout_margin="5dp"
android:background="@drawable/btnprevious"
android:onClick="click" />
<View
android:layout_width="0dip"
android:layout_height="0dip" />
<Button
android:id="@+id/btnPlay"
android:layout_width="0dip"
android:layout_height="fill_parent"
android:layout_margin="5dp"
android:background="@drawable/play"
android:onClick="click" />
<View
android:layout_width="0dip"
android:layout_height="0dip" />
<Button
android:id="@+id/btnNext"
android:layout_width="0dip"
android:layout_height="fill_parent"
android:layout_margin="5dp"
android:background="@drawable/next"
android:onClick="click" />
</LinearLayout>
</LinearLayout>
我会在这里感谢您的帮助。
【问题讨论】:
标签: android xml eclipse button