1.用法
1>.初始化ViewPager的数据

Screen Shot 2020-04-18 at 12.46.40 AM.png

Screen Shot 2020-04-18 at 12.51.54 AM.png
2>.创建PagerAdapter实现其四个方法

Screen Shot 2020-04-18 at 12.52.21 AM.png
注意LinerLayout是一个ViewGroup,在其里面添加元素应该是这样的

Screen Shot 2020-04-18 at 1.08.29 AM.png
2.另外ViewPager还有4个监听的方法

Screen Shot 2020-04-18 at 1.07.05 AM.png
3.ViewPager里面是Fragment

Screen Shot 2020-04-18 at 1.16.53 AM.png