Android支持设计渐变错误
这是我的Android支持设计渐变错误,android,android-gradle-plugin,android-appcompat,android-support-design,Android,Android Gradle Plugin,Android Appcompat,Android Support Design,这是我的build.gradle文件: ... dependencies { compile fileTree(dir: 'libs', include: ['*.jar']) compile 'com.android.support:appcompat-v7:22.0.0' compile 'com.android.support:cardview-v7:21.0.+' ... } 在我补充之前: compile 'com.android.support:de
build.gradle
文件:
...
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.android.support:appcompat-v7:22.0.0'
compile 'com.android.support:cardview-v7:21.0.+'
...
}
在我补充之前:
compile 'com.android.support:design:22.2.0'
现在,当我构建或重建我的项目时(我已经同步了几次gradle
),我会遇到以下错误:
.../utils/CustomEditText.java
Error:(6, 42) Gradle: error: cannot find symbol class TintEditText
Error:(14, 35) Gradle: error: cannot find symbol class TintEditText
Error:(37, 8) Gradle: error: cannot find symbol method isInEditMode()
Error:(57, 3) Gradle: error: cannot find symbol method setTypeface(Typeface)
Error:(65, 5) Gradle: error: method does not override or implement a method from a supertype
Error:(67, 23) Gradle: error: cannot find symbol variable super
...
在我的CustomEditText
(扩展了tinedittext
)内以及使用该CustomEditText
的所有活动内
导入不会引发任何错误,也不会引发类:
import android.support.v7.internal.widget.TintEditText;
可能是什么 更新: 使用ianhanniballake建议,
appcompatiedittext
而不是内部的tinedittext
,解决了编译时错误并回答了这个问题,但现在我遇到了一个运行时错误:
java.lang.IllegalArgumentException: AppCompat does not support the current theme features
我看到了一些与此相关的问题,提到的解决方案是:
<style name="MyMaterialTheme" parent="Theme.AppCompat.NoActionBar">
<item name="windowNoTitle">true</item>
<item name="windowActionBar">false</item>
...
</style>
在我的基地活动中
我做:
getWindow().requestFeature(mActionBarView != null ? Window.FEATURE_ACTION_BAR : Window.FEATURE_NO_TITLE);
要启用或禁用操作栏
正如我所说的,在我添加com.android.support:design:22.2.0'或将appcompat-v7:22.0.0更新到22。我只想使用
表格布局
,但我想我不会…作为版本,您应该使用而不是内部的TintEditText
我在更新到最新的android设计库后也出现了此错误。我刚更改为Edittext。AppCompativeText和普通的Edittext之间有什么区别。我看不到它们之间有什么区别them@Ranjith-如文件和博文I中所述在对这一问题的答复中,当您使用AppCompativeActivity
或等效工具时,EditText
将自动替换为AppCompativeText
,这样您就不会看到差异-AppCompativeText
仅在您正在构建EditText
的自定义子类,但需要AppCompat.TintEditText提供的着色时才有用与appcompat-v7:22.0.0配合得很好,直到我添加了设计:22.2.0,这很奇怪。这修复了编译时错误,但现在我有一个运行时错误:原因是:java.lang.IllegalArgumentException:AppCompat不支持当前主题功能从22.0.0到22.2.0包括了非常大的错误-搜索“不支持当前主题”会在我发布此问题之前出现问题,我能够找到Chris贝恩斯的问题,但他的解决方案对我不起作用。因为我只有两个标签,所以我使用了谷歌IO的方法,而且效果很好。也许以后如果我要充分利用TabLayout,我可以让它发挥作用。谢谢
getWindow().requestFeature(mActionBarView != null ? Window.FEATURE_ACTION_BAR : Window.FEATURE_NO_TITLE);