I am displaying a table view inside a uialertview and I am getting a strange white line around. I have tried to change the content mode and then call [alertView setNeedsDisplay], but it seems not working.

Could someone help? Thanks.
// increase the alertview size, if we are going to show the scope
#define ALERT_VIEW_WIDTH 750
#define ALERT_PADDING 20
- (void)willPresentAlertView:(UIAlertView *)alertView {
{
id thing;
if ( [[[alertView class] description] isEqualToString:@"UIAlertTableView"]){ //change the alert view size
int center=alertView.center.x-ALERT_VIEW_WIDTH/2;
for (thing in alertView.subviews)
{
NSLog(@"%@", [[thing class] description]);
if([[[thing class] description] isEqualToString:@"UITableView"])
{
UIView* v=(UIView*)thing;
v.frame=CGRectMake(v.frame.origin.x+ALERT_PADDING, v.frame.origin.y, ALERT_VIEW_WIDTH-ALERT_PADDING*3, 250);
}
if([[[thing class] description] isEqualToString:@"UIAlertButton"])
{
UIView* v=(UIView*)thing;
v.frame=CGRectMake(v.frame.origin.x+ALERT_PADDING, v.frame.origin.y, ALERT_VIEW_WIDTH-ALERT_PADDING*3, v.frame.size.height-10);
}
if([[[thing class] description] isEqualToString:@"UILabel"])
{
UIView* v=(UIView*)thing;
v.frame=CGRectMake(v.frame.origin.x+ALERT_PADDING, v.frame.origin.y, ALERT_VIEW_WIDTH-ALERT_PADDING*3, v.frame.size.height);
}
}
alertView.contentMode = UIViewContentModeRedraw;
alertView.frame=CGRectMake(center, alertView.frame.origin.y, ALERT_VIEW_WIDTH, 360);
[alertView setNeedsDisplay];
}
}
}
I know this is never the answer people want to hear… But displaying large amounts of data is not generally the purpose of a UIAlertView.
From Apple’s User Interface Guidelines:
“Avoid creating an alert message that is too long. If possible, keep the message short enough to display on one or two lines. If the message is too long it will scroll, which is not a good user experience.”
http://developer.apple.com/library/ios/#documentation/userexperience/conceptual/mobilehig/UIElementGuidelines/UIElementGuidelines.html
However, on a more helpful note… UIAlertViews always have that white border. However, due to how you are increasing the size of the view so drastically, the line is getting stretched out. Here is a normal UIAlertView and you can see how big the line is:
My primary advice is to redesign whatever you are trying to do so that you don’t have to display a giant message inside UIAlertView as it isn’t really appropriate most of the time.
However, if you REALLY want to get rid of the white border, you will likely have to subclass UIAlertView and override it’s drawrect to do the drawing yourself.