Я использую стиль по умолчанию UIAlertController
и UIAlertAction
, но я получаю белый текст на белом фоне, как на скриншотеIOS 8: UIAlertController Default Style Color
Вот мой код:
UIAlertController *alert = [UIAlertController alertControllerWithTitle:nil message:nil preferredStyle:UIAlertControllerStyleActionSheet];
UIAlertAction* defaultAction = [UIAlertAction actionWithTitle:@"0237826726" style:UIAlertActionStyleDefault
handler:^(UIAlertAction * action) {
[self callPlaceNumber:@"0237826726"];
}];
[alert addAction:defaultAction];
UIAlertAction* cancel = [UIAlertAction actionWithTitle:@"Cancel" style:UIAlertActionStyleDefault
handler:^(UIAlertAction * action) {
[alert dismissViewControllerAnimated:YES completion:nil];
}];
[alert addAction:cancel];
[self presentViewController:alert animated:YES completion:nil];
Я искал проблему, и я обнаружил, что могу добавить tintColor
для UIAlertController
следующим образом, но это не сработало.
alert.view.tintColor = [UIColor blackColor];
Это нормальное поведение или что-то не так в моем коде?
Проверить это http://stackoverflow.com/questions/25795065/ios-8-uiactivityviewcontroller-and-uialertcontroller-button -text-color-uses-wind/26222502 # 26222502 – AndreasZ
Это работает :), спасибо. Добавьте свой ответ, и я соглашусь с ним. – Sawsan