views:

126

answers:

1

hi, i want to know how to set the alignment of delegate message of alert view. anyone has solution, plz reply with some code.

A: 

u need to get alertView's subViews.Iterate through the array of subView's,it will be having one item of type UILable.Get that UILabel from subView array and for that u can set textAlignment property.

NSArray *subViewArray = alertView.subViews;
 for(int x=0;x<[subViewArray count];x++){
 if([[[subViewArray objectAtIndex:x] class] isSubclassOfClass:[UILabel class]])
  {
      UILabel *label = [subViewArray objectAtIndex:x];
    label.textAlignment = UITextAlignmentCenter;
  }

}