public boolean isViewFromObject(View arg0, Object arg1) {
return arg0 == arg1;
}
weibo_闲人悟静
浏览 3254回答 1
1回答
煎蛋的少年
isViewFromObject(View view, Object object)Determines whether a page View is associated with a specific key object as returned by instantiateItem(ViewGroup, int). This method is required for a PagerAdapter to function properly.Parametersview : Page View to check for association with object object : Object to check for association with view Returns true if view is associated with the key object object以上是官方文档解析。大概的意思就是判断适配器的某个视图页面是否需要关联一个特殊的对象并作为一个实例项目返回。如果判断为true , 就将view 关联到一个 object 对象。 可能就是说你pagerAdapter选中的内容是不是当成一个对象来处理的意思吧。英文不好,不怎么能理解透。