2016-07-24 80 views
0

我想使用此庫LIB 我已完成「入門」步驟。導入的AAR文件,添加了maven回購和依賴關係。我將zip文件複製到AAR導入時創建的文件夾中。當我想使用自定義的TextView導入新庫 - 屬性

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" 
xmlns:app="http://schemas.android.com/apk/res-auto" 
android:layout_width="match_parent" 
android:layout_height="match_parent" 
android:orientation="vertical"> 

<com.rey.material.widget.TabPageIndicator 
    android:id="@+id/sliding_tabs" 
    style="@styles/Material.Widget.TabPageIndicator" 
    android:layout_width="match_parent" 
    android:layout_height="wrap_content" 
    /> 

我得到錯誤:

Error:(9, 16) No resource found that matches the given name (at 'style' with value '@styles/Material.Widget.TabPageIndicator').

我能做什麼呢?

+0

你爲什麼不使用Gradle? – Eenvincible

回答

0

如果您正在使用Android的工作室 - 我希望你這樣做,你可以輕鬆地添加使用搖籃這樣這個庫:

dependencies { 
    compile 'com.github.rey5137:material:1.2.4' 
} 

但是不要忘了,包括這些必需庫根據的README文本相同的庫:

一般情況下,有你build.gradle文件看起來像這樣根據依賴關係:

dependencies { 
    compile 'com.android.support:appcompat-v7:23.4.0' 
    compile 'com.android.support:cardview-v7:23.4.0' 

    ... 
    compile 'com.github.rey5137:material:1.2.4' 
} 

接下來,同步你的項目文件,你應該設置!

我希望這可以幫助你!

+0

請告訴我整個壓縮文件(.idea,app,gradle,src,material,src等)應該放在root/material-1.2.4中嗎? – Endoplasma

+0

請勿使用zip文件;只需添加上面的幾行,如果您已經使用其他方式添加了庫中的某些文件,請刪除它們。 – Eenvincible

+0

謝謝,它很尷尬,但我不知道gradle可以自動下載庫:D – Endoplasma