2

EditText のテキストの上部が切り取られている RelativeLayout に EditText があります。EditText のパディングを増やしてみましたが、20 dp でもテキストが切り取られます。

ここに画像を投稿しようとしましたが、投稿できるほどのスタックオーバーフローの評判がないようです。小学校のように、真ん中に水平に点線が引かれた罫線入りの紙を想像してみてください。点線より上のテキストは切り取られます。

これが私のlayout.xmlです:

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
          android:layout_width="fill_parent"
          android:layout_height="fill_parent"
          android:orientation="vertical">
<RelativeLayout android:layout_width="fill_parent"
                android:layout_height="wrap_content">
    <TextView android:id="@+id/questionTextView"
              android:layout_width="wrap_content"
              android:layout_height="wrap_content"
              android:layout_marginTop="0dp"
              android:layout_marginLeft="10dp"
              android:textSize="16dp"
              android:text="Audit Question"/>
    <RadioButton android:id="@+id/answerRadioButton"
                 android:layout_width="wrap_content"
                 android:layout_height="wrap_content"
                 android:layout_below="@id/questionTextView"
                 android:layout_alignLeft="@id/questionTextView"
                 android:layout_marginTop="5dp"
                 android:checked="true"
                 android:textSize="16dp"
                 android:text="audit answer"/>
    <EditText android:id="@+id/commentEditText"
              android:layout_width="fill_parent"
              android:layout_height="wrap_content"
              android:layout_below="@id/answerRadioButton"
              android:layout_marginLeft="20dp"
              android:layout_marginRight="20dp"
              android:layout_marginBottom="10dp"
              android:padding="20dp" />
</RelativeLayout>

どんな助けでも大歓迎です。

4

3 に答える 3

2

ビューのパディングとマージンの違い

PaddingビューのコンテンツであるスペースEditTextとそれ自体の境界線の制約を追加します。つまり、なぜあなたEditTextがクリップされているのかという問題になる可能性があります-それはそれ自体を制限しています。android:layout_marginTop代わりに yourに追加してEditText、それと の間にスペースを作成してみてくださいRadioButton

于 2012-05-29T15:11:30.833 に答える
0

これが機能した理由はわかりませんが、EditTextウィジェットの下の下部にTextViewバッファーを追加すると、テキストが途切れなくなりました。

私はこれを追加しました:

    <TextView android:layout_width="fill_parent"
          android:layout_height="5dp" />

そして、EditText内のテキストは正常に見えるようになりました。

于 2012-06-05T15:19:29.327 に答える