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