আপনি পটভূমির রঙ, ফন্ট এবং পাঠ্যের রঙ পরিবর্তন করে শর্তাবলী এবং শর্তাবলী ডায়ালগ বক্সের চেহারা এবং অনুভূতি কাস্টমাইজ করতে GMSNavigationTermsDialogUIParams
অবজেক্ট ব্যবহার করতে পারেন।
উদাহরণ
নিম্নলিখিত কোড উদাহরণটি দেখায় যে কীভাবে নিয়ম ও শর্তাবলী ডায়ালগ বক্সের চেহারা এবং অনুভূতি কাস্টমাইজ করা যায়।
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 {
// ...
}
}
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 {
// …
}
}];
আপনি পটভূমির রঙ, ফন্ট এবং পাঠ্যের রঙ পরিবর্তন করে শর্তাবলী এবং শর্তাবলী ডায়ালগ বক্সের চেহারা এবং অনুভূতি কাস্টমাইজ করতে GMSNavigationTermsDialogUIParams
অবজেক্ট ব্যবহার করতে পারেন।
উদাহরণ
নিম্নলিখিত কোড উদাহরণটি দেখায় যে কীভাবে নিয়ম ও শর্তাবলী ডায়ালগ বক্সের চেহারা এবং অনুভূতি কাস্টমাইজ করা যায়।
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 {
// ...
}
}
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 {
// …
}
}];