2011-12-29 29 views
2

如何製作infobutton毗連?如何製作InfoButton毗連

UIButton *button = [UIButton buttonWithType:UIButtonTypeInfoLight]; 

UIBarButtonItem *infoItem = [[UIBarButtonItem alloc] initWithCustomView:button]; 

[button addTarget:self action:@selector(infoPressed:) forControlEvents:UIControlEventTouchUpInside]; 

我已經試過

infoItem.style = UIBarButtonItemStyleBordered; 

以及

button.style = UIBarButtonItemStyleBordered; 

但他們沒有工作。將感謝幫助。

回答

1

UIButtonTypeInfoLight沒有有邊界的版本,您將不得不創建自己的圖像以獲得加邊的信息類型按鈕。

實施例:

[[UIBarButtonItem alloc] initWithImage:@"info.png" style:UIBarButtonItemStyleBordered target:nil action:nil] // where info.png is your custom image