笔记 ImageSwitcher(图像切换器)类:

ImageSwitcher间接继承于FrameLayout类,所以ImageSwitcher可以实现动画效果

在使用时必须通过setFactory()方法为ImageSwitcher类设置一个ViewFactory,用于将显示的图片和父窗口区分开,setFactory()的参数需要通过实例化ViewSwitcher.ViewFactory接口的实现类来指定,在创建ViewSwitcher.ViewFactory接口的实现类时,需要重写makeView()方法,用于创建显示图片的ImageView,makeView()方法将返回一个显示图片的ImageView,在使用图像切换器时,setImageResource()方法方法也很重要,该方法用于指定要在ImageSwitcher中显示的图像资源

猜你喜欢

转载自blog.csdn.net/qq_42823109/article/details/93451242