create uibutton subclass

前端 未结 5 1722
说谎
说谎 2020-11-28 14:10

I tried to subclass UIButton to include an activity indicator, but when i use initWithFrame:(since i\'m subclassing uibutton i\'m not using buttonWithType:) the button doesn

5条回答
  •  悲&欢浪女
    2020-11-28 14:45

    Favour composition over inheritance.

    Create a UIView which contains the components you need and add them to your view.

提交回复
热议问题