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,但它不起作用。我必须有单独的行吗?

4

1 回答 1

3

在我看来:谁在乎?您只需在启动时执行一次,appearance代理的想法比必须为每个单独的条形按钮项执行此操作要好得多,这是过去的方式。别担心,开心,继续前进。

于 2013-04-30T01:13:45.300 回答