2014-10-02 55 views
1

我想在項目中使用JakeWharton-Android-ViewPagerIndicator。 http://viewpagerindicator.com/com.viewpagerindicator android.view.view

我解壓縮JakeWharton-Android-ViewPagerIndicator並在此文件夾中啓動了一個新項目。 在文件UnderlinePageIndicator.java我有一個錯誤:

import android.view.View; 
... 
public class UnderlinePageIndicator extends View implements PageIndicator { ... } 

錯誤:查看解決不了的類型。 我也有錯誤第1行(這是一條評論),說: 類型android.view.ViewGroup無法解析。

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 

我花了這個時間,即時出的解決方案:它是間接需要的.class文件

錯誤日誌引用。任何幫助將受到歡迎。 謝謝。

+0

發佈您的錯誤日誌。 – AndyN 2014-10-02 08:05:16

+0

和你的錯誤日誌,請添加更多的代碼...沒有一個錯誤的兩行是有點太多,我們可以幫助你 – mithrop 2014-10-02 08:12:04

+0

我不知道我可以添加什麼代碼...其餘的是精細。這只是我無法從android.view中訪問View類,而它卻被正確導入。我想它是一個項目設置的問題,因爲這個項目應該是你在自己的代碼中使用的一種庫;它沒有主應用程序,你不能自行編譯它。 – 2014-10-02 08:23:39

回答

5
  1. 進口JakeWharton-Android-ViewPagerIndicator進入烏爾區,然後右擊project->properties->android->library(scroll_down)->Add button對話框將打開,然後選擇JakeWharton-Android-ViewPagerIndicator並單擊應用/確定

  2. 然後點擊此鏈接「Adapter for circle page indicator in android」。我已經使用CirclePageIndicator與viewpager.It將絕對幫助你:)

+0

我明白了。我只是以錯誤的方式導入它(使用導入「現有項目到工作區」而不是「現有的Android代碼到工作區」)。 – 2014-10-02 09:58:13

+0

thx你的答案解決了我的問題,但我沒有15個聲望點投票給你;) – 2014-10-02 11:40:13

+0

okies親愛的。我很高興你得到了答案。因此,我的回答會幫助其他人。 :) – Rana 2014-10-02 13:44:21

相關問題