Changing the color of UITableView section headers

前端 未结 6 1265
抹茶落季
抹茶落季 2020-12-31 01:47

OK, I know that this has been asked previously, so please forgive me for asking again. It just seems like there has got to be an easier way to do this.

Is there a \

6条回答
  •  庸人自扰
    2020-12-31 02:36

    With UIAppearance you can change UILabel text color on your UITableView headers like this:

    [[UILabel appearanceWhenContainedIn:[UITableViewHeaderFooterView class], nil] setTextColor:[UIColor whiteColor]];
    [[UILabel appearanceWhenContainedIn:[UITableViewHeaderFooterView class], nil] setShadowColor:[UIColor whiteColor]];
    

    Should work on iOS 6.0+. Can be called anywhere (viewDidLoad etc).

提交回复
热议问题