我正在尝试更改UISegmentedControl的文本阴影位置.要做到这一点,该文件说,我需要在通过NSValue它包装一个UIOffset结构.
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.
Run Code Online (Sandbox Code Playgroud)
问题是NSValue没有这样的UIOffset结构的包装方法 - 只需搜索文档.我看到很多示例代码使用这个不存在的函数.
[NSValue valueWithUIOffset:UIOffsetMake(0, 1)]
Run Code Online (Sandbox Code Playgroud)
当我尝试运行它时崩溃了.我不明白有多少示例代码可以运行它.
| 归档时间: |
|
| 查看次数: |
2469 次 |
| 最近记录: |