0

This is my Edittext layout

<EditText
        android:id="@+id/txt"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_alignParentLeft="true"
        android:layout_alignParentTop="true"
        android:layout_marginLeft="0dp"
        android:layout_marginRight="0dp"
        android:gravity="center"
        android:inputType="text|textFilter|textNoSuggestions"
        android:padding="0dp"
        android:singleLine="true"
        android:textSize="15dp" android:text="S"
        android:visibility="visible" >
    </EditText>

If I try to put textSize="30dp", for example, the edittext is not resized and the letter is trouncated. Where is the problem?

shuttle1978
  • 123
  • 2
  • 12
  • Firs your textSize should be in `sp` units instead of `dp`, second I have not a clear idea of what you want to achieve :) – zozelfelfo Jun 18 '13 at 14:40
  • this is a screenshot [link](http://i41.tinypic.com/s2vg37.png), the edittext is not resized and the box is bigger of text – shuttle1978 Jun 18 '13 at 14:47

2 Answers2

4

Removing the android:inputType attribute from your Edittext will solve your problem. I don't what is the relation between this attribute and wrapping the text. but i faced this problem too.

Update: Add textMultiLine to your android:inputType attribute.

Source https://stackoverflow.com/a/3286921/2294985

Community
  • 1
  • 1
Omar HossamEldin
  • 3,033
  • 1
  • 25
  • 51
  • 2
    I just tried this. It makes the "enter" key just put a line break in the edit text. I'm looking for a way to enter a long line of text and have it wrap as opposed to scrolling horizontally. I'll be back if I find anything. – William T. Mallard Nov 21 '13 at 07:09
  • Scrolling horizontal is activated by the `android:scrollHorizontally="true"` attribute. the enter button puts line break because the inputType is textMultiLine – Omar HossamEldin Nov 21 '13 at 08:33
0

add below code to editText tag for wrap editText:

android:layout_height="wrap_content"
android:inputType="text|textMultiLine"
M Karimi
  • 1,991
  • 1
  • 17
  • 34