2011-12-05 81 views

回答

3

這是一個隱藏的(私有的)Apple價值,有人花時間弄清楚了。在UIKit中沒有常量或枚舉來創建具有該「類型」的按鈕。唯一的「官方」按鈕類型由蘋果暴露枚舉是(從UIButton.h):

typedef enum { 
    UIButtonTypeCustom = 0,   // no button type 
    UIButtonTypeRoundedRect,   // rounded rect, flat white button, like in address card 

    UIButtonTypeDetailDisclosure, 
    UIButtonTypeInfoLight, 
    UIButtonTypeInfoDark, 
    UIButtonTypeContactAdd, 
} UIButtonType; 

正如你所看到的,在這個時候,它只涵蓋0 - 5