iOS 开发实用技术导航
NSHipster 中文版
http://nshipster.cn/
cocos2d 开源 2D 游戏引擎
http://www.cocos2d-iphone.org/
CocoaPods
http://cocoapods.org/
Google Analytics for Mobile 统计解决方案
http://code.google.com/mobile/analytics/
WWDC
https://developer.apple.com/wwdc/
Design Guides and Resources
https://developer.apple.com/design/
Transcripts of WWDC sessions
http://asciiwwdc.com
Cocoa with Love
http://cocoawithlove.com/
Cocoa Dev Central
http://cocoadevcentral.com/
NSHipster
http://nshipster.com/
Style Guides
Google Objective-C Style Guide
NYTimes Objective-C Style Guide
Useful Tools and Services
Charles Web Debugging Proxy
Smore
vincentxue
V2EX  ›  iDev

为什么 UIButton 的 font 属性 Deprecated 了?

  •  
  •   vincentxue ·
    vincentsit · Jun 24, 2016 · 3659 views
    This topic created in 3624 days ago, the information mentioned may be changed or developed.

    最近在想这个问题,又没有 - (void)setFont:(UIFont *)font forState:(UIControlState)state; 这样的方法,为什么要把它置为 Deprecated ?是因为公开了 titleLabel 属性吗,两者都可以设置 font 属性,同一个属性有两个地方可以设置,不符合某个设计模式?我猜的。。

    似乎 v2 的 Markdown 语法不支持 `` 标记代码?

    5 replies    2016-06-24 16:15:30 +08:00
    dxk611
        1
    dxk611  
       Jun 24, 2016
    setAttributedTitle:<#(nullable NSAttributedString *)#> forState:<#(UIControlState)#>
    vincentxue
        2
    vincentxue  
    OP
       Jun 24, 2016
    @dxk611 我认为压根不是这个原因, font 在 3.0 就被 Deprecated 了,但是这个方法在 6.0 才出现。
    lee0100317
        3
    lee0100317  
       Jun 24, 2016
    titleLabel 3.0 后开始可用

    font
    (iOS 3.0) Property
    The font used to display text on the button.

    Deprecation Statement
    Use the font property of the titleLabel instead.
    hyyy
        4
    hyyy  
       Jun 24, 2016
    支持 markdown ,多行代码标记

    ```
    NSLog(@"%@", @"Hello World");
    ```
    vincentxue
        5
    vincentxue  
    OP
       Jun 24, 2016
    @lee0100317 你没看明白我的问题。。

    @hyyy 你说的是多行的,我说的是这个:

    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   4116 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 41ms · UTC 05:14 · PVG 13:14 · LAX 22:14 · JFK 01:14
    ♥ Do have faith in what you're doing.