首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >问答首页 >元素字体-系列必须声明

元素字体-系列必须声明
EN

Stack Overflow用户
提问于 2017-07-01 01:50:13
回答 2查看 3.1K关注 0票数 5

当我从github打开一个项目时,res文件夹中的文件夹有一个xml资源product_famliy.xml,但是android有一个错误:

代码语言:javascript
复制
Information:Gradle tasks [clean, :app:generateDebugSources, :app:generateDebugAndroidTestSources, :app:mockableAndroidJar, :app:prepareDebugUnitTestDependencies]
E:\googledownload\PaperPlane-master\app\src\main\res\font\product_family.xml
Error:Error: Unsupported type 'font'
Error:Execution failed for task ':app:mergeDebugResources'.
> E:\googledownload\PaperPlane-master\app\src\main\res\font\product_family.xml: Error: Unsupported type 'font'
Information:BUILD FAILED
Information:Total time: 21.311 secs
Information:2 errors
Information:0 warnings
Information:See complete output in console 
代码语言:javascript
复制
<?xml version="1.0" encoding="utf-8"?>
<font-family xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto">

    <font
        android:fontStyle="normal"
        android:fontWeight="400"
        android:font="@font/product_sans_regular"
        app:fontStyle="normal"
        app:fontWeight="400"
        app:font="@font/product_sans_regular"/>

    <font
        android:fontStyle="italic"
        android:fontWeight="400"
        android:font="@font/product_sans_italic"
        app:fontStyle="italic"
        app:fontWeight="400"
        app:font="@font/product_sans_italic"/>

</font-family>
EN

回答 2

Stack Overflow用户

回答已采纳

发布于 2017-07-11 07:49:42

我想你需要Android Studio 3.0

票数 5
EN

Stack Overflow用户

发布于 2017-08-21 18:15:20

这是新的Android版本(Android26)的一个新功能。

要让它使用XML中的字体,您需要安装AndroidStudio3.x并使用最新的verion (26)进行编译。

此外,请参阅此处:https://developer.android.com/preview/features/working-with-fonts.html

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/44856685

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档