0

I am adding a accessoryView in UIAlertView. accessoryView will have label with some text. I want to give label same font as UIAlertView's message font. how to get font style and font size of UIAlertView message

enter image description here

Jagat Dave
  • 1,643
  • 3
  • 23
  • 30
vaibby
  • 1,255
  • 1
  • 9
  • 23

3 Answers3

0

So unfortunately it is impossible to change the textField font, buttons text color . etc. Clearly mention in Apple's document.

UIAlertView_Class

The only solution is

1) Use UIView as Custom alertview or

2) There are lots of customised alertview available on Github with awsome animation and etc. Like, - ios-custom-alertview

and lots of just search on Google Alertview

Badal Shah
  • 7,541
  • 2
  • 30
  • 65
  • As holex writes in his comments to the question, `UIAlertView` is deprecated, and `UIAlertController` should be used instead. The latter allows for attributed strings in the alert title as well as message, so you can change font/colours in these as you wish, see e.g. [this thread](http://stackoverflow.com/questions/35141400/how-to-change-color-of-single-letters-or-one-word-in-line#comment58286120_35141400). – dfrib Feb 10 '16 at 11:05
0

You must to create your custom Alert based on UIView.

Apple provide UIAlertView "as-is" it doesn't support subclassing.

Andriy Savran
  • 535
  • 3
  • 19
0

They are predefined system font 12. I think you need not to change anything to get that font.

Sucharu Hasija
  • 1,096
  • 11
  • 23