Customizing the Terms and Conditions Dialog Box
Stay organized with collections
Save and categorize content based on your preferences.
You can use the GMSNavigationTermsDialogUIParams
object to customize the look
and feel of the Terms and Conditions dialog box by changing the background
color, the fonts, and the text colors.
Example
The following code example demonstrates how to customize the look and feel of
the Terms and Conditions dialog box.
Swift
let termsUIParams = GMSNavigationTermsDialogUIParams(
backgroundColor: .brown,
titleFont: UIFont(name:"ChalkboardSE-Bold", size:18),
titleColor: .orange,
mainTextFont: UIFont(name:"MarkerFelt-Wide", size:18),
mainTextColor: .yellow,
buttonsFont: UIFont(name:"Arial-BoldItalicMT", size:14),
cancelButtonTextColor: .green,
acceptButtonTextColor: .blue)
let termsAndConditionsOptions = GMSNavigationTermsAndConditionsOptions(companyName: "Ride Sharing Co.")
termsAndConditionsOptions.title = "Some Title"
termsAndConditionsOptions.uiParams = termsUIParams
GMSNavigationServices.showTermsAndConditionsDialogIfNeeded(
with: termsAndConditionsOptions) { termsAccepted in
if termsAccepted {
// ...
} else {
// ...
}
}
Objective-C
GMSNavigationTermsDialogUIParams *termsUIParams =
[[GMSNavigationTermsDialogUIParams alloc] initWithBackgroundColor:[UIColor brownColor]
titleFont:[UIFont fontWithName:@"ChalkboardSE-Bold" size:18]
titleColor:[UIColor orangeColor]
mainTextFont:[UIFont fontWithName:@"MarkerFelt-Wide" size:18]
mainTextColor:[UIColor yellowColor]
buttonsFont:[UIFont fontWithName:@"Arial-BoldItalicMT" size:14]
cancelButtonTextColor:[UIColor greenColor]
acceptButtonTextColor:[UIColor blueColor]];
GMSNavigationTermsAndConditionsOptions *termsAndConditionsOptions = [[GMSNavigationTermsAndConditionsOptions alloc] initWithCompanyName:@"Ride Sharing Co."];
termsAndConditionsOptions.title = @"Some Title";
termsAndConditionsOptions.uiParams = termsUIParams;
[GMSNavigationServices
showTermsAndConditionsDialogIfNeededWithOptions:termsAndConditionsOptions
callback:^(BOOL termsAccepted) {
if (termsAccepted) {
// …
} else {
// …
}
}];
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-28 UTC.
[null,null,["Last updated 2025-08-28 UTC."],[[["\u003cp\u003eThe \u003ccode\u003eGMSNavigationTermsDialogUIParams\u003c/code\u003e object allows customization of the Terms and Conditions dialog's appearance, including background color, fonts, and text colors.\u003c/p\u003e\n"],["\u003cp\u003eDevelopers can modify elements like title font, main text font, button font, and respective colors using this object.\u003c/p\u003e\n"],["\u003cp\u003eThe provided code examples demonstrate how to implement these customizations in both Swift and Objective-C.\u003c/p\u003e\n"]]],["The `GMSNavigationTermsDialogUIParams` object customizes the Terms and Conditions dialog's appearance. You can modify the background color, fonts, and text colors. Create a `GMSNavigationTermsDialogUIParams` instance, setting desired properties like `backgroundColor`, `titleFont`, and button text colors. Then, create `GMSNavigationTermsAndConditionsOptions`, set `uiParams`, company name and the title. Finally, use `GMSNavigationServices.showTermsAndConditionsDialogIfNeeded` to display the dialog and handle user acceptance.\n"],null,["# Customizing the Terms and Conditions Dialog Box\n\nYou can use the `GMSNavigationTermsDialogUIParams` object to customize the look\nand feel of the Terms and Conditions dialog box by changing the background\ncolor, the fonts, and the text colors.\n\nExample\n-------\n\nThe following code example demonstrates how to customize the look and feel of\nthe Terms and Conditions dialog box.\n\n\u003cbr /\u003e\n\n### Swift\n\n\u003cbr /\u003e\n\n let termsUIParams = GMSNavigationTermsDialogUIParams(\n backgroundColor: .brown,\n titleFont: UIFont(name:\"ChalkboardSE-Bold\", size:18),\n titleColor: .orange,\n mainTextFont: UIFont(name:\"MarkerFelt-Wide\", size:18),\n mainTextColor: .yellow,\n buttonsFont: UIFont(name:\"Arial-BoldItalicMT\", size:14),\n cancelButtonTextColor: .green,\n acceptButtonTextColor: .blue)\n\n let termsAndConditionsOptions = GMSNavigationTermsAndConditionsOptions(companyName: \"Ride Sharing Co.\")\n termsAndConditionsOptions.title = \"Some Title\"\n termsAndConditionsOptions.uiParams = termsUIParams\n\n GMSNavigationServices.showTermsAndConditionsDialogIfNeeded(\n with: termsAndConditionsOptions) { termsAccepted in\n if termsAccepted {\n // ...\n } else {\n // ...\n }\n }\n\n\u003cbr /\u003e\n\n### Objective-C\n\n\u003cbr /\u003e\n\n GMSNavigationTermsDialogUIParams *termsUIParams =\n [[GMSNavigationTermsDialogUIParams alloc] initWithBackgroundColor:[UIColor brownColor]\n titleFont:[UIFont fontWithName:@\"ChalkboardSE-Bold\" size:18]\n titleColor:[UIColor orangeColor]\n mainTextFont:[UIFont fontWithName:@\"MarkerFelt-Wide\" size:18]\n mainTextColor:[UIColor yellowColor]\n buttonsFont:[UIFont fontWithName:@\"Arial-BoldItalicMT\" size:14]\n cancelButtonTextColor:[UIColor greenColor]\n acceptButtonTextColor:[UIColor blueColor]];\n\n GMSNavigationTermsAndConditionsOptions *termsAndConditionsOptions = [[GMSNavigationTermsAndConditionsOptions alloc] initWithCompanyName:@\"Ride Sharing Co.\"];\n termsAndConditionsOptions.title = @\"Some Title\";\n termsAndConditionsOptions.uiParams = termsUIParams;\n\n [GMSNavigationServices\n showTermsAndConditionsDialogIfNeededWithOptions:termsAndConditionsOptions\n callback:^(BOOL termsAccepted) {\n if (termsAccepted) {\n // ...\n } else {\n // ...\n }\n }];\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e"]]