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.
Asked
Active
Viewed 450 times
1
-
Try: **Build > Clean Project** – null_override Sep 18 '20 at 14:01
-
I tried cleaning, rebuilding, and the good old reopening the project but it doesn't seem to be working. – Ashwin Rajesh Sep 18 '20 at 14:05
3 Answers
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

Ahmad Mahmoudi
- 91
- 9
-
The problem is the EditText is not appearing at all, I already have added hints. – Ashwin Rajesh Sep 18 '20 at 17:20
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"}.

K. Macharia
- 1
- 2
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