नियम और शर्तें वाले डायलॉग बॉक्स को पसंद के मुताबिक बनाना

GMSNavigationTermsDialogUIParams ऑब्जेक्ट का इस्तेमाल करके, 'नियम और शर्तें' डायलॉग बॉक्स के लुक और फ़ील को अपनी पसंद के मुताबिक बनाया जा सकता है. इसके लिए, बैकग्राउंड का रंग, फ़ॉन्ट, और टेक्स्ट का रंग बदला जा सकता है.

उदाहरण

यहां दिए गए कोड के उदाहरण में, नियम और शर्तों वाले डायलॉग बॉक्स के लुक और फ़ील को पसंद के मुताबिक बनाने का तरीका बताया गया है.

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 {
                                                           // …
                                                         }
                                                       }];