1

Hello this is my android studio project. I have created a EditText which actually works normally on my virtual machine, but it doesn't appear properly in the preview. I had sdk level 29 and tried downgrading to 28 however that did not fix anything. I am unsure of the reason the preview is not appearing.

My xml file and preview.

3 Answers3

1

I don't know why you want do that (setting a text in an EditText)

btw you can use this way to set the text in it https://stackoverflow.com/a/4594761/13295974

if you want to set a hint in your EditText(it is better than setting a text in it) you can use this in xml

android:hint="your hint"

I suggest you to use hint in the place of text

Good Luck

0

Refresh the layout to reload all the elements. Also, it is better to show the name as {android:hint="name"} instead of the default {android:text="Name"}.

0

I had the same issue on Android studio 4.2.1, where only EditTexts were not visible on the preview.

I fixed it like so:

File->Settings->Experimental-> (Enable Live Layout Inspector)
Mena
  • 3,019
  • 1
  • 25
  • 54