【问题标题】:What does it mean that a view is contained in a container when the container is a UIViewController?当容器是 UIViewController 时,视图包含在容器中是什么意思?
【发布时间】:2012-12-05 04:31:07
【问题描述】:

有 2 类满足 UIAppearanceContainer http://developer.apple.com/library/ios/#recipes/UIAppearanceContainer_Protocol/Reference/Reference.html#//apple_ref/occ/intf/UIAppearanceContainer

UIView UIViewController

说我们这样做:

[UIButton appearanceWhenContainedIn:@[[UYLRotatingViewController class]]];

iOS如何知道UIButton是否在UYLRotatingViewController中?

是不是说在UYLRotatingViewController的视图中?

【问题讨论】:

  • 你的意思是 UYLRotatingViewController.view 的子视图?

标签: objective-c xcode4.5


【解决方案1】:

当给定的UIButton 被赋予一个超级视图([myView addSubview:button])时,UIKit 最有可能调用[[button superview] class],并将这个类与它可能具有的任何有条件的外观定制进行比较。换句话说,如果 UIKit 发现 [[button superview] class] 等于 [UYLRotatingViewController class],它将应用您传递给此代理对象的外观自定义。

【讨论】:

    猜你喜欢
    • 2012-09-27
    • 2016-12-09
    • 1970-01-01
    • 1970-01-01
    • 2011-03-21
    • 1970-01-01
    • 2023-03-27
    • 2011-12-30
    相关资源
    最近更新 更多