Android Studio-TextView未在设计视图布局中显示 [英] Android Studio - TextView not showing in design view layout
问题描述
我是全新尝试Android应用程序的人.我开始关注在线教程( https://developer.android.com/培训/基础知识/firstapp/building-ui ),但添加新的TextView有点沮丧,根据本教程,它应该在设计视图中显示,让我来回移动.但是,在设计视图中它对我是不可见的,而我只能通过运行仿真才能看到它.如果有人做错了事,请让我知道吗?还是本教程没有告诉您的内容?还是只是一个错误?
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?
在此先感谢您提供的任何建议.
Thank you in advance for any advice you can offer.
推荐答案
最新的sdk 28中有一个错误,
There is a bug in latest sdk 28 ,
更改compileSdkVersion 27
targetSdkVersion 27
和
implementation 'com.android.support:appcompat-v7:27.1.1'
更新:
据说可以解决问题,但我尚未对其进行测试
This is said to fix problem but I did not test it yet
在styles.xml中,将应用程序的父主题更改为Base.Theme.AppCompat
而不是Theme.AppCompat
In styles.xml change the parent theme for your app to Base.Theme.AppCompat
instead of Theme.AppCompat
这篇关于Android Studio-TextView未在设计视图布局中显示的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!