【问题标题】:UIPageControl + UIAppearanceUIPageControl + UIAppearance
【发布时间】:2012-03-26 22:56:04
【问题描述】:

UIAppearance 的文档非常糟糕。

我想自定义 UIPageController 的颜色,但我无法确定要设置哪些属性。当我去[UIPagecontrol appearance] set 时,我可能有数百个选项,所以几乎不可能弄清楚是什么。

我认为 UIAppearance 代理是可能的,对吧?

谢谢

【问题讨论】:

  • 发行说明似乎有足够的信息可以开始:developer.apple.com/library/ios/#releasenotes/General/… 一个关键点似乎是检查 UI_APPEARANCE_SELECTOR 的标题(“标记参与外观代理 API 的方法。”)
  • 我不认为 UIPageControl 采用 UIAppearance 协议。页面控件实现起来相对简单;您可能必须自己制作或找到一个开源的。喜欢github.com/honcheng/iOS-StyledPageControl
  • 只是对任何阅读本文的人的更新,UIPageControl 将支持 iOS 6 中的 UIAppearance 协议。

标签: ios ios6 uipagecontrol uiappearance


【解决方案1】:

UIAppearance 协议从 iOS 6 开始添加到 UIPageControl

您可以自定义的属性有:

  • 点色调颜色
  • 突出的点色调颜色

这是 UIPageControl.h 的摘录,您可以看到这些 UIAppearance 添加仅适用于 iOS 6。

@property(nonatomic,retain) UIColor *pageIndicatorTintColor NS_AVAILABLE_IOS(6_0) UI_APPEARANCE_SELECTOR;
@property(nonatomic,retain) UIColor *currentPageIndicatorTintColor NS_AVAILABLE_IOS(6_0) UI_APPEARANCE_SELECTOR;

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2019-10-12
    相关资源
    最近更新 更多