UITableView titleForHeaderInSection shows all caps

前端 未结 14 929
孤独总比滥情好
孤独总比滥情好 2021-01-30 16:28

I am using titleForHeaderInSection to show a header for a UITableView section. It worked fine with the iOS6 SDK, but the iOS7 SDK shows the header in all CAPS.

I guess

14条回答
  •  轻奢々
    轻奢々 (楼主)
    2021-01-30 17:07

    With RubyMotion / RedPotion, paste this into your TableScreen:

      def tableView(_, willDisplayHeaderView: view, forSection: section)
        view.textLabel.text = self.tableView(_, titleForHeaderInSection: section)
      end
    

    I think what's happening is that somewhere in there the text gets set to ALL CAPS. This little trick RESETS the text back to whatever it was originally. Works like a charm for me!

提交回复
热议问题