Different cell bg color depending on iOS version (4.0 to 5.0)

后端 未结 6 1836
深忆病人
深忆病人 2021-01-02 07:51

I have a custom grouped UITableViewCell, with a couple of UILabels on it. Since the UITableViewCell background color used to be pure white, it matched the UILabels\' default

6条回答
  •  刺人心
    刺人心 (楼主)
    2021-01-02 08:23

    You can call:

     [[UIDevice currentDevice] systemVersion]
    

    Although that is discouraged for a lot of reasons, and I'm not sure it's the best way to solve your problem. In principle, you should be able to deploy view code and get the consistent results you want by some other means.

    If you do actually want to compare device versions, you'd probably set a property and check the device's OS when the view controller loads, as opposed to within your cellForRowAtIndexPath...

提交回复
热议问题