轮播图的point在一开始是显示的,轮播的图片加载后,点点point消失不可见??
【领券联盟】
请问:
轮播图的point在一开始是显示的,但是轮播图的looperPager的imageView(图片)加载到UI后,point就不见了
for (int i = 0; i < contents.size(); i++) {
View point = new View(getContext());
int size = SizeUtils.dip2px(getContext(),8);
LinearLayout.LayoutParams layoutParams = new LinearLayout.LayoutParams(size,size);
layoutParams.setMarginStart(SizeUtils.dip2px(getContext(),5));
layoutParams.setMarginEnd(SizeUtils.dip2px(getContext(),5));
point.setLayoutParams(layoutParams);
if(i == 0) {
point.setBackgroundResource(R.drawable.shape_indicator_point_selected);
} else {
point.setBackgroundResource(R.drawable.shape_indicator_point_normal);
}
//looperContainer是point(轮播图上的点点的视图)的坑(容器),就是一个LinearLayout
looperContainer.addView(point);
}
}
你用tools-layout inspector看看是不是真的不见了呢。
如果是不见了,就看看哪里remove了。
因为你的点只有add和remove的操作