2

after I update Xcode from 4.1 to 4.2, UIAlertView's others button can't display correctly. UIAlertView in Xcode 4.2

and when I debug, the Rename button is UIAlertButton class and its frame is frame = (0 0; 0 0); could you give a hand?

Cœur
  • 37,241
  • 25
  • 195
  • 267
Jane_Meng
  • 749
  • 1
  • 9
  • 18

2 Answers2

3

UIAlertView just behave very badly when being subclassed. Apple seems to try to make it nearly impossible to subclass it.

But there are ways around it. The best one: A UIAlertView replacement — a view, that recreates the features of UIAlertView, without being one. TSAlertView is such a replacement.

For iOS 5 the alertViewStyle might help you.

Zoe
  • 27,060
  • 21
  • 118
  • 148
vikingosegundo
  • 52,040
  • 14
  • 137
  • 178
0

I think the fast way to fix that may like it's:

alert = [[YourSubclassOfUIAlertView alloc] initWithTitle:@"Change my name"
message:@"From now on, I want to know as:\n\n"  /* Add \n\n to expand the UIAlertView space */ delegate:.....

BTW: @vikingosegundo was right. And you will find this post usefull: Customizing UIAlertView

Community
  • 1
  • 1
BB9z
  • 2,432
  • 1
  • 30
  • 36