0

I have a UIAlertView which is very narrow for its content. As a result, entire message is not readable. When the message exceeds usual size, the area becomes white instead of default blue.

Also, I have 3 buttons in total. They all appear in vertical instead of horizontal line.

How can I change this? I have very simple requirement and do not want to subclass it as far as possible.

Nirav Bhatt
  • 6,940
  • 5
  • 45
  • 89
  • You can't change this behavior. This is how `UIAlertView` works. If you need something different, you need a custom or 3rd party solution. – rmaddy Nov 11 '12 at 18:40
  • I'm sure you're doing this, but if you use the `message` field and leave the `title` as `nil`, you can fit a little more text. But anything more than that, you have to subclass or roll your own. – Rob Nov 11 '12 at 18:51
  • look here... http://stackoverflow.com/questions/4548387/uialertview-not-displaying-complete-message – TonyMkenu Nov 12 '12 at 00:07

1 Answers1

0

You can not do that by the default alert view because the text area inside it is not accessible,

you have to subclass it to get what you want, read this demo to subclass the uialertview it is easy and straight to point

http://mobile.tutsplus.com/tutorials/iphone/ios-sdk-uialertview-custom-graphics/

Omar Freewan
  • 2,678
  • 4
  • 25
  • 49
  • 1
    What happens if Apple completely changes the implementation of `UIAlertView` in the future? The article you link to is a really bad idea. For the amount of work being done in that article, it would be much better and safer to create a custom class that does not extend `UIAlertView`. There are plenty of 3rd party replacements for `UIAlertView` that won't break if Apple changes their implementation. – rmaddy Nov 11 '12 at 18:51
  • the subclassing is solves a lot of problems with default functionality, in my opinion it is better than 3rd party i used to use the third party in my projects but at each ios update i fall in the same problem :the third party doesnot support this ios yet? so i prefer to use the subclassing, its issues is always solvable by the developer – Omar Freewan Nov 11 '12 at 19:06