问题
I want to create a TabLayout
with ViewPager
. I'm using api version 22. I'm getting this error
TabLayout cannot be resolved to a type
I'm using Eclipse for development.
回答1:
You were remaining with adding support library in your project.
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:
- 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.
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'
来源:https://stackoverflow.com/questions/35456147/tablayout-cannot-be-resolved-to-a-type-eclipse