PLA_AbsListViewThe method initializeScrollbars(TypedArray) is undefined for the type PLA_AbsListView
2016-03-08 21:10
399 查看
The method initializeScrollbars(TypedArray) is undefined for the type PLA_AbsListView
这个错误,很多人认为是 API版本太低,initializeScrollbars这个函数没有办法用,
真正的解决方法是采用:反射的机制来搞定,因为,我们知道方法名,方法的参数,所以就可以这样做,
final TypedArray a = context.getTheme().obtainStyledAttributes(new int[0]);
try {
// initializeScrollbars(TypedArray)
Method initializeScrollbars = android.view.View.class.getDeclaredMethod("initializeScrollbars", TypedArray.class);
initializeScrollbars.invoke(this, a);
} catch (Exception e) {
e.printStackTrace();
}
这种方法是最有效果的,
一般这种错误是出现在自定义的view中的构造函数里面。
这个错误,很多人认为是 API版本太低,initializeScrollbars这个函数没有办法用,
真正的解决方法是采用:反射的机制来搞定,因为,我们知道方法名,方法的参数,所以就可以这样做,
final TypedArray a = context.getTheme().obtainStyledAttributes(new int[0]);
try {
// initializeScrollbars(TypedArray)
Method initializeScrollbars = android.view.View.class.getDeclaredMethod("initializeScrollbars", TypedArray.class);
initializeScrollbars.invoke(this, a);
} catch (Exception e) {
e.printStackTrace();
}
这种方法是最有效果的,
一般这种错误是出现在自定义的view中的构造函数里面。
相关文章推荐
- 栈堆全局文字常量区程序代码区
- poj2559单调栈
- 关于AnyChat录像解决方案的几张原理图
- Python 学习之字典
- 我的第一个C++程序
- HDU 3533 Escape BFS搜索
- 出差(十四)
- codeforces 650C. Table Compression 并查集
- Redis常用命令
- 腾讯后台开发技术总监浅谈过载保护 小心雪崩效应
- 五. Django的forms与ModelForm
- POJ 2186 Popular Cows(强连通分量缩点)
- MySQL常用命令
- 九度OJ 1417-1430(4/14)
- CGAL join_vertex source code analysis
- mysql开辟新用户并授权相应权限
- EVC编程点滴(概述)-注册表操作类
- 学习进度条
- 大数相乘、开方
- Java单例模式