Android Question Solved - edittext word wrap

doogal

Member
Licensed User
I have a edittext that no longer wraps like it should. I have the following code in my app:
I found this on the forums and it used to work.
B4X:
Activity.LoadLayout("edit")
    edtPurpose.InputType = Bit.OR(edtPurpose.INPUT_TYPE_TEXT, 16384)
    edtPurpose.Wrap = True
I also have:
SingleLine = False
Wrap = True
in Designer

and it looks like this:

Also, how can I go back to the box style edittext versus the line. Where the line looks more elegant some users like the box style.

Thank you,
Douglas
 

klaus

Expert
Licensed User
What is the Gravity value ?
It is probably set to CENTER.
You should set it to edtPurpose.Gravity = Bit.OR(Gravity.LEFT, Gravity.TOP)
The text size seems big according to the EditText.Height.
 

doogal

Member
Licensed User
Klaus, Thank you for your quick response. :) Gravity is already set in designer just like you show Left and Top. Does it need to be set in code like wrap for it to work correctly? The edittext.height is 90 and textsize is 14.
Here is a scaled down version of what I am working with if you don't mind taking a look.
Douglas
 

Attachments

doogal

Member
Licensed User
Thank you that worked. I don't understand though it used to work without this.
My other question was how to get the box style back? I saw somewhere on the forum about target a lower sdk. I can't seem to find it at the moment. Do you know of a way to get this style back?

Again. Thank you.
 

klaus

Expert
Licensed User
On my Sony xperia z1 commenting this line in the Manifest Editor shows the box style.
'SetApplicationAttribute(android:theme, "@android:style/Theme.Holo")
 
Top