1

这是我的布局中的一部分

    <LinearLayout android:orientation="vertical"
        android:layout_height="wrap_content" android:layout_below="@id/checkBox_block_all"
        android:id="@+id/linearLayout_addtoblack" android:layout_width="fill_parent">
        <LinearLayout android:id="@+id/linearLayout2"
            android:layout_width="match_parent" android:layout_height="wrap_content"
            android:gravity="center">
            <LinearLayout android:id="@+id/linearLayout3"
                android:layout_width="wrap_content" android:layout_height="match_parent"
                android:orientation="vertical" android:layout_weight="1">
                <TextView android:id="@+id/textView1"
                    android:layout_height="wrap_content" android:text="Enter the full number"
                    android:layout_width="fill_parent"></TextView>
                <EditText android:layout_width="match_parent"
                    android:layout_height="wrap_content" android:id="@+id/editText1"
                    android:textSize="18sp">
                    <requestFocus></requestFocus>
                </EditText>
            </LinearLayout>
            <Button android:layout_width="wrap_content"
                android:layout_height="wrap_content" android:id="@+id/button_add"
                android:text="Add to black list" android:layout_weight="1"></Button>
        </LinearLayout>
    </LinearLayout>

这是它的样子

在此处输入图像描述

关键是我希望文本框更大,我用值 wrap_parent 设置高度,我希望文本框足够大,但不是这样,你可以看到的文本框以某种方式被裁剪,我不知道为什么,任何帮助,建议,什么?,我不想为文本框的高度设置固定值

4

2 回答 2

2

在“添加到黑名单”按钮中,将 layout_height 更改为“fill_parent”

该按钮使编辑文本更小,因为它们的基线已对齐

于 2012-01-09T16:34:08.650 回答
0

您的 Button 限制了高度,因此您可以将按钮的 layout_hieght 设置为匹配父级,或者如果这看起来很奇怪,请将按钮放在线性布局中并将新的线性布局的高度设置为 match_parent

但我认为最好的方法是使用 RelativeLayout 并将所有 3 个视图放在同一布局中

于 2012-01-09T16:34:36.240 回答