【发布时间】:2013-11-17 06:42:00
【问题描述】:
我正在处理PSPDFKIT,
我需要注释工具栏中add and remove buttons 的解决方案。
我想change some default annotation images。
谁能建议我如何解决这些问题,提前谢谢!!!
【问题讨论】:
标签: ios ipad pdf ios6 pspdfkit
我正在处理PSPDFKIT,
我需要注释工具栏中add and remove buttons 的解决方案。
我想change some default annotation images。
谁能建议我如何解决这些问题,提前谢谢!!!
【问题讨论】:
标签: ios ipad pdf ios6 pspdfkit
在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]];
【讨论】:
toolbar对象是从哪里得到的吗?是self.annotationToolbarController?.annotationToolbar 吗?