我试图创建一个类似于Google Music App的Heading +按钮,例如哪里有“诗经”头在左边,然后在右侧有一个与文本“X多”的按钮..RelativeLayout中的按钮大小和填充
我使用的RelativeLayout为TextView的和按钮
我的问题是按钮占用了包含文本的布局的大小,高度是全部错误的,并且填充似乎没有做任何事情。
<ScrollView
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent" >
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical" >
[REMOVED for clarity]
<RelativeLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@color/list_foreground"
android:orientation="vertical" >
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:padding="10dp"
android:text="@string/photos"
android:textAppearance="?android:attr/textAppearanceMedium" />
<Button
android:id="@+id/photo_button"
style="?android:attr/buttonStyleSmall"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:background="@color/actionbar_background"
android:padding="10dp"
android:text="test" />
</RelativeLayout>
我在这里做错了什么?