V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
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
expkzb
V2EX  ›  iDev

对于 iOS 应用来说,你倾向于用哪种方式控制样式

  •  
  •   expkzb · 2015-08-07 21:50:36 +08:00 · 2440 次点击
    这是一个创建于 3178 天前的主题,其中的信息可能已经有所发展或是发生改变。

    一、宏

    类似于:

    #define FontTypeSmallTitle [UIFont fontWithName:@"Arial" size:14]
    

    二、继承

    类似于:

    @interface TypeALabel : UILabel
    

    三、使用类似 css 样式表写法的类库

    欢迎补充

    13 条回复    2015-10-04 11:09:53 +08:00
    pengjay
        1
    pengjay  
       2015-08-07 22:02:08 +08:00   ❤️ 1
    Category
    vulgur
        2
    vulgur  
       2015-08-07 22:18:38 +08:00   ❤️ 1
    继承
    SeanChense
        3
    SeanChense  
       2015-08-07 22:26:18 +08:00 via iPhone   ❤️ 1
    像 font 、color 这样的直接 Category
    tigerZhang
        4
    tigerZhang  
       2015-08-07 22:28:10 +08:00
    Category
    xi_lin
        5
    xi_lin  
       2015-08-07 23:39:33 +08:00
    @SeanChense 怎么用Category做呢?
    hdbean
        6
    hdbean  
       2015-08-08 00:13:54 +08:00
    分类
    SeanChense
        7
    SeanChense  
       2015-08-08 00:13:59 +08:00 via iPhone
    @xi_lin http://seanchense.github.io/blog/use_category_in_ios_project.html 我写的一点说明,如有漏洞请见谅。
    LINAICAI
        8
    LINAICAI  
       2015-08-08 00:19:21 +08:00
    绝对Category好用。。。
    xi_lin
        9
    xi_lin  
       2015-08-08 00:31:49 +08:00 via iPhone
    @SeanChense 懂了,理解叉了~谢谢分享
    fhefh
        10
    fhefh  
       2015-08-08 10:37:22 +08:00
    学习了 谢谢
    likers
        11
    likers  
       2015-08-12 12:29:26 +08:00
    @SeanChense 可以理解为是重载UIColor吗
    SeanChense
        12
    SeanChense  
       2015-08-12 13:07:51 +08:00
    @likers Category 不能算重载因为不是继承。
    likers
        13
    likers  
       2015-10-04 11:09:53 +08:00
    @SeanChense 了解了,谢谢!
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   1118 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 25ms · UTC 18:29 · PVG 02:29 · LAX 11:29 · JFK 14:29
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.