2017-11-29 15 views
0

최근에 이클립스 프로젝트를 모든 SDK 26을 업데이트 한 후 안드로이드 스튜디오로 변환했습니다.
내 프로젝트 XML에서 글꼴 패밀리를 사용하여 사용자 정의 글꼴을 시도했지만 제대로 표시됩니다.
그러나 프로젝트를 실행하고 모바일에서 볼 때 업데이트되지 않습니다.Font Family가 내 프로젝트에서 작동하지 않습니까?

도와주세요. 먼저가

  • 당신의 UI 구성 요소에 해당 디렉토리 3.now에 글꼴 파일 (.TTF)을 복사 "글꼴"라는 프로젝트 디렉토리를 생성

    apply plugin: 'com.android.application' 
    
    android { 
    compileSdkVersion 26 
    buildToolsVersion '26.0.2' 
    useLibrary 'org.apache.http.legacy' 
    defaultConfig { 
        applicationId "xx.xxx.xx.xxx" 
        minSdkVersion 16 
        targetSdkVersion 26 
        versionCode 1 
        versionName "1.0" 
        testInstrumentationRunner 
        "android.support.test.runner.AndroidJUnitRunner" 
        multiDexEnabled true 
    } 
    buildTypes { 
        release { 
         minifyEnabled false 
         proguardFiles getDefaultProguardFile('proguard-android.txt'), 
         'proguard-rules.pro' 
        } 
    } 
    
    packagingOptions { 
        exclude 'META-INF/DEPENDENCIES' 
        exclude 'META-INF/LICENSE' 
        exclude 'META-INF/LICENSE.txt' 
        exclude 'META-INF/license.txt' 
        exclude 'META-INF/NOTICE' 
        exclude 'META-INF/NOTICE.txt' 
        exclude 'META-INF/notice.txt' 
        exclude 'META-INF/ASL2.0' 
    } 
    
    sourceSets { main { assets.srcDirs = ['src/main/assets', 
    'src/main/res/assets/'] } } 
    } 
    
    dependencies { 
    compile fileTree(dir: 'libs', include: ['*.jar']) 
    
    compile project(':xxx') 
    
    compile project(':xxxxx') 
    
    compile project(':xxxx') 
    
    compile project(':xxxxxx') 
    
    compile project(':xxxxx') 
    
    compile project(':xxxxxx') 
    
    compile 'com.google.code.gson:gson:1.6' 
    
    compile files('libs/AppMeasurement_Android.jar') 
    
    compile files('libs/commons-io-2.1.jar') 
    
    
    compile files('libs/commons-lang-2.6.jar') 
    
    /* compile files('libs/jackson-core-asl-1.9.5.jar') 
    
    compile files('libs/jackson-mapper-asl-1.9.5.jar')*/ 
    
    //compile files('libs/json-path-0.8.0.jar') 
    
    compile files('libs/json-smart-1.1.jar') 
    
    //compile files('libs/libGoogleAnalyticsV2.jar') 
    
    //compile files('libs/nineoldandroids-2.4.0.jar') 
    
    compile 'com.google.android.gms:play-services-analytics:10.2.4' 
    
    compile 'com.android.support.constraint:`enter code here`constraint- 
    layout:1.0.2' 
    
    
    } 
    
  • +0

    코드를 확인해야합니다 –

    +0

    내 매니페스트를 확인하십시오 – user533787

    답변

    0
    1. 다음은이

    추가 이

    작동합니다 텍스트 뷰

    <TextView 
    android:fontFamily="@font/your_font" 
    android:text="Font is working"/> 
    

    희망이다

    +0

    나는 위에서 언급 한 내용을 이미 사용하고 있습니다. 작동하지 않습니다 – user533787

    +0

    xml 파일을 질문에 추가하십시오 –