Java 未找到属性';文本颜色';包装内';安卓';——建筑时
我是新来的,现在正在使用Android Studio。我已经使用XML创建了单页设计,但当我使用emulator运行代码时,会显示以下消息: 信息:渐变任务[:app:assembleDebug] C:\Users\MHTAREQ\AndroidStudioProjects\JustJava\app\src\main\res\layout\activity\u main.xml 错误:(10)在中找不到属性“fontColor”的资源标识符 包“android”错误:(21)找不到的资源标识符 包“android”中的属性“fontColor” C:\Users\MHTAREQ\AndroidStudioProjects\JustJava\app\build\mediates\res\merged\debug\layout\activity\u main.xml 错误:(10)在中找不到属性“fontColor”的资源标识符 包“android”错误:(21)找不到的资源标识符 包“android”中的属性“fontColor”错误:执行失败 任务“:应用程序:processDebugResources” com.android.ide.common.process.ProcessException:无法执行aapt信息:生成失败信息:总时间:1分钟25.346秒信息:5个错误信息:0个警告信息:请参阅控制台中的完整输出 以下是XML代码:Java 未找到属性';文本颜色';包装内';安卓';——建筑时,java,android,xml,android-layout,Java,Android,Xml,Android Layout,我是新来的,现在正在使用Android Studio。我已经使用XML创建了单页设计,但当我使用emulator运行代码时,会显示以下消息: 信息:渐变任务[:app:assembleDebug] C:\Users\MHTAREQ\AndroidStudioProjects\JustJava\app\src\main\res\layout\activity\u main.xml 错误:(10)在中找不到属性“fontColor”的资源标识符 包“android”错误:(21)找不到的资源标识符
xmlns:android=”http://schemas.android.com/apk/res/android"
xmlns:tools=”http://schemas.android.com/tools"
android:layout\u width=“匹配父项”
android:layout\u height=“match\u parent”
工具:context=“com.example.android.justjava.MainActivity”>
请提供帮助。尝试使用android:textColor标记而不是fontColorTextView没有特定的“fontColor”属性,这就是为什么它会给您这个错误 加
然后清理项目并重建。共享代码,发布XML。什么是fontColor?上面添加了XML代码这里是字体颜色:@android:color/black谢谢。它起作用了!但现在出现了新的问题,即“包R不存在”这个问题的解决方案是什么?请尝试清理您的项目并从Android Studio的“构建”菜单中重建它
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context="com.example.android.justjava.MainActivity">
<TextView
android:id="@+id/quantity_text_view"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="quantity"
android:textAllCaps="true"
android:textSize="16sp"
android:fontColor="@android:color/black"
android:layout_marginLeft="16dp"
android:layout_marginTop="16dp"/>
<TextView
android:id="@+id/zero_text_view"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="0"
android:layout_below="@+id/quantity_text_view"
android:textSize="16sp"
android:fontColor="@android:color/black"
android:layout_marginLeft="16dp"
android:layout_marginTop="16dp"/>
<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="order"
android:textAllCaps="true"
android:layout_below="@+id/zero_text_view"
android:layout_marginLeft="16dp"
android:layout_marginTop="16dp"
android:onClick="submitOrder"/>
android:textColor="#FFFFFF"