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

あなたのボタンは高さを制限しているので、ボタンのlayout_hieghtをmatch-parentにするか、それが奇妙に見える場合は、ボタンをlinearlayoutに入れて新しいlinearlayoutの高さをmatch_parentにすることができます

しかし、最善の方法は RelativeLayout を使用し、3 つのビューすべてを同じレイアウトに配置することだと思います

于 2012-01-09T16:34:36.240 に答える