TabLayout无法解析为Eclipse类型 [英] TabLayout cannot be resolved to a type- Eclipse
问题描述
我想用ViewPager
创建一个TabLayout
.我正在使用api版本22.出现此错误
I want to create a TabLayout
with ViewPager
. I'm using api version 22. I'm getting this error
TabLayout无法解析为类型
TabLayout cannot be resolved to a type
我正在使用Eclipse进行开发.
I'm using Eclipse for development.
推荐答案
您仍然需要在项目中添加支持库.
You were remaining with adding support library in your project.
在使用设计支持库之前,您必须从android-sdks \ extras \ android \ support \ v7 \ appcompat导入support-v7-appcompat库.然后,您必须:
Before use the design support library, you have to import support-v7-appcompat library from android-sdks\extras\android\support\v7\appcompat. Then, you have to:
- 在eclipse中创建一个android库项目以提供设计支持 图书馆
- 放入目录的内容 设计支持中的android-sdks \ extras \ android \ support \ design 图书馆项目
- 将appcompat-v7库链接到设计支持库项目
- 从您的项目中链接支持库项目.
- create an android library project in eclipse for design support library
- put the contents of directory android-sdks\extras\android\support\design in the design support library project
- Link appcompat-v7 library to design support library project
- Link support library project from your project.
您不能直接使用jar android-support-design.jar,因为 您还需要一些资源(这是aar格式的原因).
You can not use directly the jar android-support-design.jar because you need some resources too (this is the reason of aar format).
For more info just check Error in styles_base.xml file - android app - No resource found that matches the given name 'android:Widget.Material.ActionButton'
这篇关于TabLayout无法解析为Eclipse类型的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!