需要使用编程方式设置页面控件的边框颜色,或者界面生成器边框不应该设置为完成页面控件,只需要为点应用边框颜色。
我知道UIcontrol没有层属性,它是用于页控件的超类。
我试着在上面添加动态视图。
还是让我知道有没有其他可能的方法
发布于 2016-12-17 09:50:20
使用如下代码:
对于(int i= 0;i< _pageControl.numberOfPages;i++) {
UIView* dot = [_pageControl.subviews objectAtIndex:i];
if (i == _pageControl.currentPage) {
dot.backgroundColor = [UIColor whiteColor];
dot.layer.cornerRadius = dot.frame.size.height / 2;
} else {
dot.backgroundColor = [UIColor clearColor];
dot.layer.cornerRadius = dot.frame.size.height / 2;
dot.layer.borderColor = [UIColor whiteColor].CGColor;
dot.layer.borderWidth = 1;
}
}希望它能帮到你。
https://stackoverflow.com/questions/37824563
复制相似问题