2017-10-10 1 views
0

Android Studio 및 java로 첫 번째 앱을 만들었습니다. 내 프로젝트에 게이지를 추가하고 "sc-gauges"(Github)라는 라이브러리를 발견했습니다. build.gradle에 maven 리포지토리와 종속성을 추가했으며 외부 라이브러리에서 sc-gauges-2.6.4를 볼 수 있습니다. 나는 GitHub의 페이지에서 예제를 추가 :XML을 구문 분석하는 중 오류가 발생했습니다 : 언 바운드 접두사 (외부 라이브러리)

<?xml version="1.0" encoding="utf-8"?> 
<android.support.constraint.ConstraintLayout 
xmlns:android="http://schemas.android.com/apk/res/android" 
xmlns:tools="http://schemas.android.com/tools" 
xmlns:app="http://schemas.android.com/apk/res-auto" 
android:layout_width="match_parent" 
android:layout_height="match_parent" 
app:layout_behavior="@string/appbar_scrolling_view_behavior" 
tools:showIn="@layout/activity_main" 
tools:context="com.example.gauge.gauge.MainActivity"> 

<com.sccomponents.gauges.ScArcGauge 
    android:layout_width="300dp" 
    android:layout_height="wrap_content" 
    android:padding="30dp" 
    android:background="#f5f5f5" 
    sc:angleStart="135" 
    sc:angleSweep="270" 
    sc:strokeSize="6dp" 
    sc:progressSize="4dp" 
    sc:value="45" 
    sc:notches="8" 
    sc:notchesLength="10dp" 
    sc:textTokens="01|02|03|04|05|06|07|08" 
    sc:pointerRadius="10dp" 
    /> 

</android.support.constraint.ConstraintLayout> 

com.sccomponents.gauges.ScArcGauge가 작동하지만 SC에 대한 오류 : (12) 오류 분석 XML : 언 바운드 접두사 접두사 난 오류가 발생합니다. 나는 쉬운 수정이있는 것처럼 느껴진다. 그러나 자바 프로그래밍과 안드로이드 스튜디오에 완전히 익숙하지 않기 때문에 그것을 찾을 수 없었다. 말

xmlns:sc="http://schemas.android.com/apk/res-auto" 

:

+0

접두사처럼 "SC"보이는 다른 사람처럼 예를 들어 ... 상단 레이아웃에 수입되지 않습니다 'xml : android'는 아무런 문제없이 아래에 임포트되어 사용됩니다. 해당 제약 정보를 제약 레이아웃에 포함하는 방법을 확인하십시오 ... – deHaar

+0

나는 그것을 찾고 있지만 그것을 찾을 수 없습니다. – Ingmar05

+0

@ W0rmH0le이 정확한 답을주었습니다 ... 자동 리소스 포함 – deHaar

답변

1

XML 파일이 추가

<?xml version="1.0" encoding="utf-8"?> 
<android.support.constraint.ConstraintLayout 
    xmlns:android="http://schemas.android.com/apk/res/android" 
    xmlns:tools="http://schemas.android.com/tools" 
    xmlns:app="http://schemas.android.com/apk/res-auto" 
    xmlns:sc="http://schemas.android.com/apk/res-auto" 
    android:layout_width="match_parent" 
    android:layout_height="match_parent" 
    app:layout_behavior="@string/appbar_scrolling_view_behavior" 
    tools:showIn="@layout/activity_main" 
    tools:context="com.example.gauge.gauge.MainActivity"> 
관련 문제