android 使用TabLayout出现的问题
2016-05-05 16:29
417 查看
android 使用TabLayout出现的问题
在项目中 使用 viewpager+TabLayout达到滑动美观的效果,运行项目后报出如下错误
![](https://img-blog.csdn.net/20160505162209978)
![](https://img-blog.csdn.net/20160505162411483)
看了下相关资料,出错的原因是 activity的 theme不是AppCompat的
activity android:name=”.ui.GoodsInfoActivity”
android:theme=”@style/nornal_style”
把theme改成AppTheme之后运行正常
附 AppTheme
在项目中 使用 viewpager+TabLayout达到滑动美观的效果,运行项目后报出如下错误
看了下相关资料,出错的原因是 activity的 theme不是AppCompat的
activity android:name=”.ui.GoodsInfoActivity”
android:theme=”@style/nornal_style”
把theme改成AppTheme之后运行正常
附 AppTheme
<!-- Base application theme. --> <style name="AppTheme" parent="Theme.AppCompat.Light.NoActionBar"> <!-- Customize your theme here. --> <item name="colorPrimary">@color/colorPrimary</item> <item name="colorPrimaryDark">@color/colorPrimaryDark</item> <item name="colorAccent">@color/colorAccent</item> </style>
相关文章推荐
- 使用C++实现JNI接口需要注意的事项
- Android IPC进程间通讯机制
- Android Manifest 用法
- [转载]Activity中ConfigChanges属性的用法
- Android之获取手机上的图片和视频缩略图thumbnails
- Android之使用Http协议实现文件上传功能
- Android学习笔记(二九):嵌入浏览器
- android string.xml文件中的整型和string型代替
- i-jetty环境搭配与编译
- android之定时器AlarmManager
- android wifi 无线调试
- Android Native 绘图方法
- Android java 与 javascript互访(相互调用)的方法例子
- android 代码实现控件之间的间距
- android FragmentPagerAdapter的“标准”配置
- Android"解决"onTouch和onClick的冲突问题
- android:installLocation简析
- android searchView的关闭事件
- SourceProvider.getJniDirectories