Change size of UITableView?

Discussion in 'iOS Programming' started by ArtOfWarfare, Aug 23, 2011.

  1. ArtOfWarfare macrumors G3


    Nov 26, 2007
    I'm trying to add a UITableView to a UIAlertView, but I have the issue that it seems to be ignoring its frame property and drawing itself at full size...

    I have this:
    FriendSelectController *friendSelect = [[FriendSelectController alloc] init];
    friendSelect.view.frame = CGRectMake(20.0, 40.0, 240.0, 120.0);
    friendSelect.view.bounds = CGRectMake(20.0, 40.0, 240.0, 120.0);
    friendSelect.view.clipsToBounds = YES;
    [alert addSubview:friendSelect.view];
    It only responds to touch events within the bounds, as it should, but it draws well past where it should. The origin is being placed in the correct location.
  2. dantastic macrumors 6502a


    Jan 21, 2011
    You're trying to add a UITableViewController to your view. You shouldn't have 2 controllers in the same view. Add an actual UITableView to your view and it will behave just fine

Share This Page