How to set UIButton font via appearance proxy in iOS 8?

前端 未结 4 1325
难免孤独
难免孤独 2020-12-18 11:41

I tried to set the font of UIButton via appearance proxy. But it doesn\'t seem to work. This is what I tried.

UIButton.appearance().titleFont = UI

4条回答
  •  甜味超标
    2020-12-18 12:37

    You are trying to set a font of UILabel inside UIButton. Since UILabel is not tagged with UI_APPEARANCE_SELECTOR. You can't do it like this.

    Look at the list of the UIAppearance elements at: What properties can I set via an UIAppearance proxy?

提交回复
热议问题