【发布时间】:2012-03-30 21:29:25
【问题描述】:
我正在尝试更改 UISegmentedControl 的文本阴影位置。为此,documentation 说我需要传入一个包装 UIOffset 结构的NSValue。
UITextAttributeTextShadowOffset
Key to the offset used for the text shadow in a text attributes dictionary.
The corresponding value is an instance of NSValue wrapping a UIOffset struct.
Available in iOS 5.0 and later.
Declared in UIStringDrawing.h.
问题是NSValue 没有这样的 UIOffset 结构的包装方法 - 只需搜索文档即可。我看到很多sample code 使用这个不存在的功能。
[NSValue valueWithUIOffset:UIOffsetMake(0, 1)]
当我尝试运行它时它崩溃了。我不明白有多少示例代码可以运行它。
【问题讨论】:
标签: ios cocoa-touch