开发者

Apply an affine transformation to view in Interface Builder

开发者 https://www.devze.com 2023-01-17 07:22 出处:网络
Is it possible to apply an affine transformation to a view directly in Interface Builder? I know I can attach an outlet and assign it to the transform in code, but I\'d like 开发者_如何学Gothe conveni

Is it possible to apply an affine transformation to a view directly in Interface Builder? I know I can attach an outlet and assign it to the transform in code, but I'd like 开发者_如何学Gothe convenience of visually tweaking the transform in Interface Builder.


Nope. Sorry.

There are several properties that would be nice to set in IB. Occasionally Apple adds them, and then IB warns you that it's "only supported in iPhone OS 3.0 and above" or similar (I think this is the case for contentEdgeInsets on some class or other).

There's a very small chance that you can edit the XML, guess the right property name, and set it to the right string (probably whatever NSStringFromCGAffineTransform returns), but I think if it was possible, Apple would've included it.

There's a slightly larger chance that you can edit the xib, add a custom property, and use a category to override -[UIView initWithCoder:] and load your custom property. You can also write an InterfaceBuilder plugin for a custom view class which supports setting the transform in IB...

0

精彩评论

暂无评论...
验证码 换一张
取 消