Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8197833
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T05:49:19+00:00 2026-06-07T05:49:19+00:00

I am displaying a table view inside a uialertview and I am getting a

  • 0

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.
enter image description here

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];
        }        
    }
}
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-07T05:49:21+00:00Added an answer on June 7, 2026 at 5:49 am

    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:

    UIAlertView Image

    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.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to have a Table View displaying the content of a generic SQLite
I currently have a UIAlertview displaying a grouped table view and have spent all
I have an NSFetchedResultsController displaying places in a table view, but when I update
I'm missing something fundamental here. I have a table view with each cell displaying
I have a View controller displaying some information (not table views). I have an
I have a simple cocoa application with a table view displaying a few entries.
I have table view in that click any i am displaying data in overlay
Rails 2.3.5 I have a view displaying 'employee' records in a table where each
I have a table called States and i am displaying values of states in
Anyone have sugestion or example on how displaying Google Datastore records table with pagination

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.