android的获取ViewPager当前页卡布局id?

2025-04-16 05:32:14
推荐回答(1个)
回答1:

先定位到相应的页卡,比如你有3个页卡分别是View1,View2,View3。
那么你要走在View1中添加就这样写
RelativeLayout insertLayout = (RelativeLayout)View1.findViewById(R.id.screen).

View2中就是
RelativeLayout insertLayout = (RelativeLayout)View2.findViewById(R.id.screen).
以此类推