我正在尝试使用IntelliJ为ViewPagerIndicator构建示例。
我目前收到的错误是这样的(我收到了很多):
[Sample] ~/projects/ViewPagerIndicator-2.4.1-0/sample/res/values/styles.xml:19: error: Error: No resource found that matches the given name: attr 'vpiCirclePageIndicatorStyle'.
到目前为止我所做的:
- 我使用现有的样本源创建了一个新项目
- 然后,我进入项目结构,从ActionBarSherlock和ViewPagerIndicator浏览的现有源中添加新模块到"库"文件夹
- 列出项目
- 我使ActionBarSherlock模块成为ViewPagerIndicator的依赖项
- 我使ActionBarSherlock模块和ViewPagerIndicator成为"samples"模块的依赖项
他们都在使用Android 4.1平台SDK。我没有对源代码进行任何更改。
编辑:根据要求,样本的styles.xml和AndroidManifest.xml发布在这里:http://pastebin.com/YQxYy3md
同样,我没有做任何修改,ViewPagerIndicator 的网站上可以访问原始源代码
实际上在另一个问题中找到了解决方案:https://stackoverflow.com/a/10627940/347565
我缺少的是检查项目结构中的"是库项目吗"…->模块->ViewPagerIndicator->Android
我想这是允许依赖于该库的项目使用资源和属性的部分。。。
编辑:为了确保我捕捉到所有细节,相关性设置如下:
- ActionBarSherlock依赖于android-support-v4.jar(这个设置为Export)
- ViewPagerIndicator依赖于ActionBarSherlock
- 示例(用于ViewPagerIndicator)依赖于ActionBarSherlock和ViewPagerIndicator
复制任何资源:
/library/src/com/viewpagerindicator
进入/sample/src/com/viewpagerindicator
/library/res/color
进入/sample/res/
/library/res/drawable/vpi__tab_indicator.xml
进入/sample/res/drawable/
/library/res/drawable-hdpi
进入/sample/res/drawable-hdpi
/library/res/values/
进入/sample/res/values
我使用这个源代码
还导入示例项目附带的库项目。它会修复