UIButton

按钮类型

按钮的类型定义其基本外观和行为。创建按钮后,你无法更改其类型。最常用的按钮类型是自定义和系统类型,但在适当时使用其他类型

  • UIButtonTypeCustom

    No button style.
    
  • UIButtonTypeSystem

    A system style button, such as those shown in navigation bars and toolbars.
    
  • UIButtonTypeDetailDisclosure

    A detail disclosure button.
    
  • UIButtonTypeInfoLight

    An information button that has a light background.
    
  • UIButtonTypeInfoDark

    An information button that has a dark background.
    
  • UIButtonTypeContactAdd

    A contact add button.
    

创建自定义按钮(即自定义类型的按钮)时,按钮的框架最初设置为(0,0,0,0)。在将按钮添加到界面之前,应将帧更新为更合适的值。