1

我正在努力PSPDFKIT

我需要add and remove buttons注释工具栏中的解决方案。

我想change some default annotation images

谁能建议我如何解决这些问题,提前谢谢!!!

4

1 回答 1

0

PSPDFViewController中初始化PSPDFDocument时添加自定义按钮

PSPDFBrightnessBarButtonItem * brightnessBtn = [[PSPDFBrightnessBarButtonItem alloc] initWithPDFViewController:self]; // PSPDFKIT native button

UIBarButtonItem * closeBtn = [[UIBarButtonItem alloc] initWithTitle:@"Home" style:UIBarButtonItemStyleBordered target:self action:@selector(close:)]; // Custom button with title.

UIButton * moonBtn = [[UIButton alloc] initWithFrame:CGRectMake(0,0,20,20)]; // Custom button with image.
[moonBtn setImage:[UIImage imageNamed:@"icon____.png"] forState:UIControlStateNormal];[moonBtn addTarget:self action:@selector(moonTapped) forControlEvents:UIControlEventTouchDown];
UIBarButtonItem * moontab = [[UIBarButtonItem alloc] initWithCustomView:moonBtn];

如果是导航栏 -

  navigationItem.leftBarButtonItems/rightBarButtonItems = @[brightnessBtn, closeBtn, moontab];

如果是工具栏 -

 [toolbar setItems:@[brightnessBtn, closeBtn, moontab]];
于 2013-11-06T09:03:12.140 回答