我发现定制UIPageControl
页面图像非常容易(我已经检查了iOS7/8):
[self setValue:[UIImage imageNamed:@"my_icon_for_off_state"] forKey:@"_pageImage"];
[self setValue:[UIImage imageNamed:@"my_icon_for_on_state"] forKey:@"_currentPageImage"];
但我想知道我是否可以用这段代码发布我的应用程序,因为这些变量在UIPageControl
中被声明为私有?
根据Apple的规定,您不能在项目中使用私有的API。
但是我们可以。别担心。老实说,在提交应用程序时,通知他们你已经使用了xyz代码
苹果不批准使用不安全的私人API的应用程序
很多时候,我使用了私人API,苹果公司批准了它。
诚实就是简单
的一个例子
如您所述,这些属性由Apple声明为私有属性,因此您将无法使用它们。您可以使用pageIndicatorTintColor
和currentPageIndicatorTintColor
更改页面"点"的色调。