应用仿射变换以在 Interface Builder 中查看
是否可以直接在 Interface Builder 中将仿射变换应用于视图?我知道我可以附加一个插座并将其分配给代码中的转换,但我希望能够方便地在 Interface Builder 中直观地调整转换。
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 the convenience of visually tweaking the transform in Interface Builder.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
没有。对不起。
有几个属性最好在 IB 中设置。有时Apple会添加它们,然后IB警告您它“仅在iPhone OS 3.0及更高版本中受支持”或类似的(我认为某些类或其他类上的contentEdgeInsets就是这种情况)。
您可以编辑 XML、猜测正确的属性名称并将其设置为正确的字符串(可能是 NSStringFromCGAffineTransform 返回的任何内容)的可能性非常小,但我认为如果可能的话,Apple 会'我已经把它包括在内了。
您更有可能编辑 xib、添加自定义属性并使用类别来覆盖
-[UIView initWithCoder:]
并加载您的自定义属性。您还可以为自定义视图类编写 InterfaceBuilder 插件,该插件支持在 IB 中设置转换...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...