0
[[UIBarButtonItem appearance] setBackgroundImage:pressedButtonBackground30 forState:UIControlStateNormal style:UIBarButtonItemStyleBordered barMetrics:UIBarMetricsDefault];
[[UIBarButtonItem appearance] setBackgroundImage:pressedButtonBackground24 forState:UIControlStateNormal style:UIBarButtonItemStyleBordered barMetrics:UIBarMetricsLandscapePhone];
[[UIBarButtonItem appearance] setBackgroundImage:pressedButtonBackground30 forState:UIControlStateHighlighted style:UIBarButtonItemStyleDone barMetrics:UIBarMetricsDefault];
[[UIBarButtonItem appearance] setBackgroundImage:pressedButtonBackground24 forState:UIControlStateHighlighted style:UIBarButtonItemStyleDone barMetrics:UIBarMetricsLandscapePhone];
在一篇文章中,我看到有人有UIBarButtonItemStyleBordered|UIBarButtonItemStyleDone
作爲style
值,但它不起作用。我必須有單獨的行嗎?爲多個狀態設置外觀 - 有沒有辦法以較少的行來完成此操作?