繁体   English   中英

使用Android库项目时生成错误

[英]Build errors while using Android library project

我正在尝试在github上使用此库项目:

https://github.com/pakerfeldt/android-viewflow

此Android库项目可进行水平滑动。

我将解释我如何使用此库的动作:

  1. 我从github下载了该项目,并将“现有项目导入Workspace”导入了“ viewflow”项目。 (Eclipse给出了一些错误,但我已修复它们。这不是问题。)
  2. 我创建了一个新的android项目,名称为“ test”。
  3. 我将viewflow项目添加到测试项目的构建路径中。 (使用Java构建路径->项目->添加)
  4. 这是我的main.xml:
 <?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res/com.example.test" android:layout_width="fill_parent" android:layout_height="fill_parent" android:orientation="vertical" > <LinearLayout android:id="@+id/header_layout" android:layout_width="fill_parent" android:layout_height="wrap_content" android:gravity="center_horizontal" android:orientation="vertical" > <org.taptwo.android.widget.TitleFlowIndicator android:id="@+id/viewflowindic" android:layout_width="fill_parent" android:layout_height="wrap_content" android:layout_marginTop="10dip" app:clipPadding="5dp" app:footerColor="#FFFFC445" app:footerLineHeight="2dp" app:footerTriangleHeight="10dp" app:selectedColor="#FFFFC445" app:selectedSize="12dp" app:textColor="#FFFFFFFF" app:textSize="11dp" app:titlePadding="10dp" > </org.taptwo.android.widget.TitleFlowIndicator> </LinearLayout> <org.taptwo.android.widget.ViewFlow android:id="@+id/viewflow" android:layout_width="fill_parent" android:layout_height="fill_parent" android:duplicateParentState="true" > </org.taptwo.android.widget.ViewFlow> </LinearLayout> 

但是Eclipse给出了以下错误:

Description Resource    Path    Location    Type
R cannot be resolved to a variable  Main.java   /test/src/com/example/test  line 14 Java Problem
R cannot be resolved to a variable  Main.java   /test/src/com/example/test  line 19 Java Problem
error: No resource identifier found for attribute 'titlePadding' in package 'com.example.test'  main.xml    /test/res/layout    line 15 Android AAPT Problem
error: No resource identifier found for attribute 'textSize' in package 'com.example.test'  main.xml    /test/res/layout    line 15 Android AAPT Problem
error: No resource identifier found for attribute 'textColor' in package 'com.example.test' main.xml    /test/res/layout    line 15 Android AAPT Problem
error: No resource identifier found for attribute 'selectedSize' in package 'com.example.test'  main.xml    /test/res/layout    line 15 Android AAPT Problem
error: No resource identifier found for attribute 'selectedColor' in package 'com.example.test' main.xml    /test/res/layout    line 15 Android AAPT Problem
error: No resource identifier found for attribute 'clipPadding' in package 'com.example.test'   main.xml    /test/res/layout    line 15 Android AAPT Problem
error: No resource identifier found for attribute 'footerColor' in package 'com.example.test'   main.xml    /test/res/layout    line 15 Android AAPT Problem
error: No resource identifier found for attribute 'footerLineHeight' in package 'com.example.test'  main.xml    /test/res/layout    line 15 Android AAPT Problem
error: No resource identifier found for attribute 'footerTriangleHeight' in package 'com.example.test'  main.xml    /test/res/layout    line 15 Android AAPT Problem

我导入了其示例项目( https://github.com/pakerfeldt/android-viewflow/tree/master/viewflow-example ),它运行良好!

问题可能与名称空间有关,但我无法解决。

app:selectedSize =“ 12dp”删除此行

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM