Advertisement
Guest User

Untitled

a guest
Oct 23rd, 2014
128
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.30 KB | None | 0 0
  1. alert = [[UIAlertView alloc] initWithTitle: @"How to use buttons"
  2. message: @"line 1. line 2, line 3 "
  3. delegate: nil
  4. cancelButtonTitle: @"OK"
  5. otherButtonTitles: nil];
  6.  
  7. UIAlertView *alert = [[UIAlertView alloc]
  8. initWithTitle: @"How to use buttons"
  9. message: [NSString stringWithFormat: @"%C line 1.n %C line 2,n %C line 3", (unichar) 0x2022, (unichar) 0x2022, (unichar) 0x2022];
  10. delegate: nil
  11. cancelButtonTitle:@"OK"
  12. otherButtonTitles:nil];
  13.  
  14. NSArray *subViewArray = alertView.subviews;
  15. for(int x = 0; x < [subViewArray count]; x++){
  16.  
  17. //If the current subview is a UILabel...
  18. if([[[subViewArray objectAtIndex:x] class] isSubclassOfClass:[UILabel class]]) {
  19. UILabel *label = [subViewArray objectAtIndex:x];
  20. label.textAlignment = NSTextAlignmentLeft;
  21. }
  22. }
  23.  
  24. NSArray *subviewArray = alert.subviews;
  25. for(int x = 0; x < [subviewArray count]; x++){
  26.  
  27. if([[[subviewArray objectAtIndex:x] class] isSubclassOfClass:[UILabel class]]) {
  28. UILabel *label = [subviewArray objectAtIndex:x];
  29. label.textAlignment = UITextAlignmentLeft;
  30. }
  31.  
  32. alert.backgroundColor=[UIColor redColor];
  33.  
  34. @"line 1.nline 2,nline 3"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement