我正在努力PSPDFKIT
,
我需要add and remove buttons
注释工具栏中的解决方案。
我想change some default annotation images
。
谁能建议我如何解决这些问题,提前谢谢!!!
在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]];