com.viewpagerindicator android.view.view

The*_*ret 1 android viewpagerindicator

我正在尝试在项目中使用JakeWharton-Android-ViewPagerIndicator. http://viewpagerindicator.com/

我解压缩了JakeWharton-Android-ViewPagerIndicator并在此文件夹中启动了一个新项目.在文件UnderlinePageIndicator.java中我有一个错误:

import android.view.View;
...
public class UnderlinePageIndicator extends View implements PageIndicator { ... }
Run Code Online (Sandbox Code Playgroud)

错误:无法将视图解析为某种类型. 我在第1行也有错误(这是一个注释),说: android.view.ViewGroup类型无法解析.它是从所需的.class文件间接引用的

错误日志:

Description Resource    Path    Location    Type
The project was not built since its build path is incomplete. Cannot find the class file for android.view.ViewGroup. Fix the build path then try building this project  JakeWharton-Android-ViewPagerIndicator-8cd549f      Unknown Java Problem

Description Resource    Path    Location    Type
The type android.view.ViewGroup cannot be resolved. It is indirectly referenced from required .class files  UnderlinePageIndicator.java /JakeWharton-Android-ViewPagerIndicator-8cd549f/library/src/com/viewpagerindicator  line 1  Java Problem
Run Code Online (Sandbox Code Playgroud)

我花了几个小时才解决这个问题.欢迎任何帮助.谢谢.

小智 5

  1. 导入 JakeWharton-Android-ViewPagerIndicator到您的工作区,然后右键单击您的project->properties->android->library(scroll_down)->Add button对话框将打开,然后选择JakeWharton-Android-ViewPagerIndicator并单击 apply/ok.

  2. 然后点击此链接" android中的圆形页面指示器适配器 ".我使用了带有viewpager的CirclePageIndicator.它绝对会帮助你:)