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
fundon
V2EX  ›  iDev

在 macOS 和 Swift 3.0 中如何修改 NSTableRowView row 的 highlight 后的背景颜色

  •  
  •   fundon · Aug 8, 2016 · 4039 views
    This topic created in 3585 days ago, the information mentioned may be changed or developed.
    尝试了 drawSelection , selectionHighlightStyle 都不能自定义用颜色
    8 replies    2016-08-10 21:40:08 +08:00
    fundon
        1
    fundon  
    OP
       Aug 8, 2016
    自己解决了。
    xjbeta
        2
    xjbeta  
       Aug 9, 2016
    求分享代码 stack overflow 上找的 大多不怎么理想 和原来的蓝色相差挺大
    fundon
        4
    fundon  
    OP
       Aug 10, 2016
    @xjbeta 记得把 rowView 的 selectionHighlightStyle 设置为 .none
    xjbeta
        5
    xjbeta  
       Aug 10, 2016
    @fundon 和 Alternating rows 一起用有点小问题 而且不支持多选 :P
    fundon
        6
    fundon  
    OP
       Aug 10, 2016
    @xjbeta 好,我现在的需求只要单选。找到解决方案分享下 :)
    xjbeta
        7
    xjbeta  
       Aug 10, 2016
    思路是 把 row 换成 selectedIndexs 然后用 foreach 遍历 修改每个 view 的颜色
    放在 tableViewSelectionIsChanging 里 这个通知有时候蜜汁不会调用
    放在 tableViewSelectionDidChange 里 又有点慢半拍的感觉
    fundon
        8
    fundon  
    OP
       Aug 10, 2016
    tableViewSelectionDidChange 肯定慢半拍
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   975 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 27ms · UTC 19:38 · PVG 03:38 · LAX 12:38 · JFK 15:38
    ♥ Do have faith in what you're doing.