找不到资源android:style/TextAppearance.Material [英] resource android:style/TextAppearance.Material not found

查看:133
本文介绍了找不到资源android:style/TextAppearance.Material的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试为Android编写Hello World程序.这是我第一次接触Java. Gradle无法正常运行,每当我尝试重新运行它时,它都会显示24条错误消息:

I am trying to write a Hello World program for android. This is my first experience of Java. Gradle is not running properly, and whenever I try to rerun it, it comes up with 24 error messages:

resource android:style/TextAppearance.Material not found

,然后也没有找到android:style/TextAppearance.Material的许多属性.我尝试过在线搜索如何在styles.xml中添加一些内容来解决此问题,但是找不到有用的东西.

and then lots of attributes of android:style/TextAppearance.Material which are also not found. I have tried searching online for how to put something in styles.xml to fix this, but can't find anything useful.

推荐答案

尝试将您的主题更改为Android支持库的材料设计主题. 不要忘记也包括支持库.

Try to change you theme to an Android Support Library's material design theme. Don't forget to include the Support Library as well.

清单:

<application android:theme="@style/Theme.AppCompat">

Gradle Build文件:

Gradle Build file:

dependencies {
    implementation 'com.android.support:appcompat-v7:27.1.0'
}

我还建议您阅读样式和主题文档. https://developer.android.com/guide/topic/ui/look-and-feel/themes.html

I would also recommend to you that you read the Styles and Themes documentation. https://developer.android.com/guide/topics/ui/look-and-feel/themes.html

这篇关于找不到资源android:style/TextAppearance.Material的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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