【发布时间】:2017-03-03 12:50:40
【问题描述】:
我创建了一个自定义对话框,但并非所有按钮都适合。我不知道为什么会这样,在android studio中预览看起来不错,但在手机中却不好看。
这是我的布局:
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
>
<TextView
android:id="@+id/text"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="Wybierz grupę:"
android:textColor="#000000"
/>
<Spinner
android:id="@+id/fd_valSp"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@+id/text"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true"
android:layout_marginTop="20dp" />
<LinearLayout
android:layout_below="@+id/fd_valSp"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
<Button android:id="@+id/cancel_button"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/cancel" />
<Button android:id="@+id/add_group_button"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/add_new_group"
/>
<Button android:id="@+id/add"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/add"
/>
</LinearLayout>
</RelativeLayout>
【问题讨论】:
标签: java android android-layout android-xml