Customizing the Frame of the Annotation Toolbar
To customize the frame of the annotation toolbar, in your PSPDFViewController
subclass, override flexibleToolbarContainerContentRect(_:for:)
and return a customized rect. Ask super
for the default rect if you want to customize it for only one position or if you want to slightly modify it:
override func flexibleToolbarContainerContentRect(_ container: PSPDFFlexibleToolbarContainer, for position: PSPDFFlexibleToolbarPosition) -> CGRect { var rect = super.flexibleToolbarContainerContentRect(container, for: position) if position == .positionLeft { rect.origin.x += 50 } return rect }
- (CGRect)flexibleToolbarContainerContentRect:(nonnull PSPDFFlexibleToolbarContainer *)container forToolbarPosition:(PSPDFFlexibleToolbarPosition)position { CGRect rect = [super flexibleToolbarContainerContentRect:container forToolbarPosition:position]; if (position == PSPDFFlexibleToolbarPositionLeft) { rect.origin.x += 50; } return rect; }
For more details about the various ways you can customize the look of the annotation toolbar, refer to our guides on customizing the annotation toolbar and appearance styling.