تخصيص مربع الحوار الخاص بالبنود والشروط

يمكنك استخدام الكائن 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)

GMSNavigationServices.showTermsAndConditionsDialogIfNeeded(
                withTitle: "Some Title",
                companyName: "Your Company Name",
                uiParams: termsUIParams) { 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]];

[GMSNavigationServices
    showTermsAndConditionsDialogIfNeededWithTitle:@"Some Title"
                                      companyName:@"Nav Demo Company"
                                         UIParams:termsUIParams
                                         callback:^(BOOL termsAccepted) {
                                                         if (termsAccepted) {
                                                           // …
                                                         } else {
                                                           // …
                                                         }
                                                       }];