TabLayout无法解析为Eclipse类型 [英] TabLayout cannot be resolved to a type- Eclipse

查看:104
本文介绍了TabLayout无法解析为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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆