Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
327 views
in Technique[技术] by (71.8m points)

Android Studio - TextView not showing in design view layout

I am brand new to trying out an android app. I started to follow the online tutorial (https://developer.android.com/training/basics/firstapp/building-ui), but getting a bit frustrated at adding a new TextView, as according to the tutorial, it should show in design view, and let me move it around. It is invisible to me in design view though, and I can only see it by running an emulation. Please can someone let me know if I am doing something wrong? or something the tutorial does not tell you? or is this just a bug?

Android Studio Screenshot

Thank you in advance for any advice you can offer.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

There is a bug in latest sdk 28 ,

Change the compileSdkVersion 27

targetSdkVersion 27

and

implementation 'com.android.support:appcompat-v7:27.1.1'

Update:

This is said to fix problem but I did not test it yet

In styles.xml change the parent theme for your app to Base.Theme.AppCompat instead of Theme.AppCompat


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

2.1m questions

2.1m answers

60 comments

57.0k users

...