Android Studio - TextView 未显示在设计视图布局中 [英] Android Studio - TextView not showing in design view layout

查看:51
本文介绍了Android Studio - TextView 未显示在设计视图布局中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是尝试 Android 应用程序的新手.我开始关注在线教程(https://developer.android.com/training/basics/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 有一个 bug,

There is a bug in latest sdk 28 ,

更改compileSdkVersion 27

targetSdkVersion 27

实现'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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆