Android Question EditText Cursor lost in textview

rafaelmotaquintana

Active Member
Licensed User
I have 2 scenarios. One EditText added in designer, on a white panel. Cursor shows as normal.

In other case, over the same panel, I add this edittext

B4X:
   Private t As EditText
            t.Initialize("Txt_ConfigChange")
            t.Text = Tabla.GetString("translation"))
            t.Tag = Tabla.GetInt("ID")
            p.AddView(t, 0, LblLabel.Height+1, 100%x, TxT_Label.Height)
            t.TextColor = Colors.Black
            t.TextSize = 14

Here, text background is also white, but cursor is not present (well, maybe it is , but I can't see it)
Why could be happening?
 

rafaelmotaquintana

Active Member
Licensed User
Its a massive app, more than 30,000 lines.
I think it has something to do with these line in the manifest

B4X:
SetActivityAttribute(Main,  android:windowSoftInputMode, "stateHidden|adjustPan")
SetApplicationAttribute(android:theme, "@android:style/Theme.Holo")

I had to use them because in certain devices cursor disappears.
Add t.Color = Colors.Red as you told, shows the cursor. The problem is that cursor is white and the box is white also.
But what I dont get is that if the editbox is added in a designer layout, cursor is something like blue and everything works fine.
What I'll do is to use a darker color for this textbox. Not what I wanted but is something....
 
Upvote 0
Top