2012-05-29 2 views
1

У меня есть EditText в RelativeLayout, где вершины текста в EditText обрезаются. Я попытался увеличить заполнение для EditText, но даже при 20dp текст по-прежнему обрезается.Точки обрезания текста в EditText

Я попытался опубликовать изображение здесь, но, по-видимому, у меня недостаточно репутации для stackoverflow, чтобы я мог опубликовать его. Представьте себе выровненную бумагу с пунктирной линией горизонтально посередине, как в школе. Текст обрезается для чего-либо выше пунктирной линии.

Вот мой 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> 

Любая помощь будет принята с благодарностью.

ответ

0

Непонятно, почему это сработало, но когда я добавил буфер TextView внизу под виджем EditText, текст больше не был отключен.

Я добавил это:

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

И текст в EditText теперь выглядит как положено.

1

Difference between a View's Padding and Margin

Padding добавит пространство было содержание вашего EditText зрения и приграничные constaints само по себе означает, что она может быть проблема, почему ваш EditText в настоящее время clipped-- это contraining себя. Попробуйте добавить android:layout_marginTop в ваш EditText вместо этого, чтобы создать пространство между ним и RadioButton.

+0

Я тоже пробовал это, но это тоже не сработало. – NLam