首先,为了避免滑动冲突,我们要继承ViewFlow,重写onInterceptTouchEvent public class MyViewFlow extends ViewFlow { private ViewPager mPager; public MyViewFlow(Context context, AttributeSet attrs) { super(context, attrs); } public void setViewPager(ViewPager viewPager) { m
class Foo: x = 1 def __init__(self,y): self.y = y def __getattr__(self,item): print("---->from getattr:你找的属性不存在") def __setattr__(self,key,value): print('----> from setattr') # self.key = value # 这样就无限递归 # self.__dict__[key] = value #应该这样写