GoogleNavigation Framework Reference
Stay organized with collections
Save and categorize content based on your preferences.
GMSNavigationAccessoryView
@protocol GMSNavigationAccessoryView <NSObject>
Protocol defining methods that support custom views specifying accessory UI elements applied to
the primary view. Accessory views must implement this protocol in order to be visible.
-
Declaration
Swift
func heightForAccessoryViewConstrained(to size: CGSize, on mapView: GMSMapView) -> CGFloat
Objective-C
- (CGFloat)heightForAccessoryViewConstrainedToSize:(CGSize)size
onMapView:
(nonnull GMSMapView *)mapView;
Return Value
Desired height of the accessory view constrained to the given size.
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2025-08-27 UTC.
[null,null,["Last updated 2025-08-27 UTC."],[[["\u003cp\u003eThe \u003ccode\u003eGMSNavigationAccessoryView\u003c/code\u003e protocol enables customization of accessory UI elements on the main view.\u003c/p\u003e\n"],["\u003cp\u003eImplementing this protocol is necessary for accessory views to be displayed.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003eheightForAccessoryViewConstrainedToSize:onMapView:\u003c/code\u003e method determines the desired height of the accessory view, confined by a given size, within the map view.\u003c/p\u003e\n"]]],["The `GMSNavigationAccessoryView` protocol defines how custom accessory UI elements are displayed on a primary view. Accessory views must implement this protocol to be visible. The key method is `heightForAccessoryViewConstrainedToSize:onMapView:`, which determines the desired height of the accessory view, given a size constraint and a `GMSMapView` instance. This method must return the height of the accessory view when constrained to a specific size.\n"],null,["# GoogleNavigation Framework Reference\n\nGMSNavigationAccessoryView\n==========================\n\n @protocol GMSNavigationAccessoryView \u003cNSObject\u003e\n\nProtocol defining methods that support custom views specifying accessory UI elements applied to\nthe primary view. Accessory views must implement this protocol in order to be visible.\n- `\n ``\n ``\n `\n\n ### [-heightForAccessoryViewConstrainedToSize:onMapView:](#/c:objc(pl)GMSNavigationAccessoryView(im)heightForAccessoryViewConstrainedToSize:onMapView:)\n\n `\n ` \n\n #### Declaration\n\n Swift \n\n func heightForAccessoryViewConstrained(to size: CGSize, on mapView: ../Classes/GMSMapView.html) -\u003e CGFloat\n\n Objective-C \n\n - (CGFloat)heightForAccessoryViewConstrainedToSize:(CGSize)size\n onMapView:\n (nonnull ../Classes/GMSMapView.html *)mapView;\n\n #### Return Value\n\n Desired height of the accessory view constrained to the given `size.`"]]