Android 引用第三方库报错(floatingactionbutton)

报错:

Android resource linking failed
C:\Users\zoukaicai\Desktop\testFBA\app\src\main\res\layout\activity_main.xml:10: error: attribute fab_orientation (aka com.ruijie.testfba:fab_orientation) not found.
C:\Users\zoukaicai\Desktop\testFBA\app\src\main\res\layout\activity_main.xml:10: error: attribute fab_spacing (aka com.ruijie.testfba:fab_spacing) not found.
C:\Users\zoukaicai\Desktop\testFBA\app\src\main\res\layout\activity_main.xml:18: error: attribute fab_orientation (aka com.ruijie.testfba:fab_orientation) not found.
C:\Users\zoukaicai\Desktop\testFBA\app\src\main\res\layout\activity_main.xml:18: error: attribute fab_spacing (aka com.ruijie.testfba:fab_spacing) not found.
C:\Users\zoukaicai\Desktop\testFBA\app\src\main\res\layout\activity_main.xml:27: error: attribute fab_orientation (aka com.ruijie.testfba:fab_orientation) not found.
C:\Users\zoukaicai\Desktop\testFBA\app\src\main\res\layout\activity_main.xml:27: error: attribute fab_spacing (aka com.ruijie.testfba:fab_spacing) not found.
C:\Users\zoukaicai\Desktop\testFBA\app\src\main\res\layout\activity_main.xml:37: error: attribute fab_orientation (aka com.ruijie.testfba:fab_orientation) not found.
C:\Users\zoukaicai\Desktop\testFBA\app\src\main\res\layout\activity_main.xml:37: error: attribute fab_spacing (aka com.ruijie.testfba:fab_spacing) not found.
error: failed linking file resources.

 

解决方案:

使用第三方包之前要先引入design包

compile 'com.android.support:design:25.3.1'

由于是第三方库的控件,因此要用它的完整地址:android.support.design.widget.FloatingActionButton

你可能感兴趣的:(Android)