UITableView not obeying storyboard settings

  • I've got a UITableView within another view on a storyboard as in the example here:

    https://docs.google.com/file/d/0B3FbUXsjem4pcFJkeWpTVzVRdVU/edit?pli=1

    In my storyboard, the rect of the UITableView is (0, 313, 768, 598), and I am navigating to the scene ala a segue.

    But as soon as viewDidLoad is called, the frame rect of the UITableView is  (0 0; 768 911).

    I'm not setting this anywhere and setting  UITableView.frame back to CGRectMake(0, 313, 768, 598) doesn't do anything on viewDidLoad or viewWillAppear.

    Can anyone point out what I'm missing or doing wrong and why this is resizing to full screen in the first place??

    Thanks in advance,
    - Alex Zavatone
  • Have you connected an IBOutlet from code & then linked it in storyboard? I
    assume you are programmatically setting the frame on this IBOutlet. And,
    Did you check the Table View object's autosizing in Storyboard?

    To debug, you can try adding another table view object (ignore the
    problematic one) completely programmatically (don't configure it via
    storyboard) and set it to the same frame size  (0, 313, 768, 598). BTW, how
    do you get 768 & 598? Are they valid? YOu can also try setting the height &
    width of the problematic tableview to something smaller just for a try (say
    (0,200,320,100).

    On Tue, Jul 31, 2012 at 12:37 PM, Alex Zavatone <zav...> wrote:

    > I've got a UITableView within another view on a storyboard as in the
    > example here:
    >
    > https://docs.google.com/file/d/0B3FbUXsjem4pcFJkeWpTVzVRdVU/edit?pli=1
    >
    > In my storyboard, the rect of the UITableView is (0, 313, 768, 598), and I
    > am navigating to the scene ala a segue.
    >
    >
    > But as soon as viewDidLoad is called, the frame rect of the UITableView is
    > (0 0; 768 911).
    >
    > I'm not setting this anywhere and setting  UITableView.frame back to
    > CGRectMake(0, 313, 768, 598) doesn't do anything on viewDidLoad or
    > viewWillAppear.
    >
    > Can anyone point out what I'm missing or doing wrong and why this is
    > resizing to full screen in the first place??
    >
    > Thanks in advance,
    > - Alex Zavatone
    >
  • Ahh, thought I caught this before it went out.

    In any case, it appears that setting the frame of a UITableView doesn't do anything on viewDidLoad, or viewWillAppear, but does work on viewDidAppear.

    And the reason the tableView didn't obey the storyboard settings was that the parent view wasn't wired to the class's view outlet.

    Cheers.

    On Jul 31, 2012, at 3:07 AM, Alex Zavatone wrote:

    > I've got a UITableView within another view on a storyboard as in the example here:
    >
    > https://docs.google.com/file/d/0B3FbUXsjem4pcFJkeWpTVzVRdVU/edit?pli=1
    >
    > In my storyboard, the rect of the UITableView is (0, 313, 768, 598), and I am navigating to the scene ala a segue.
    >
    >
    > But as soon as viewDidLoad is called, the frame rect of the UITableView is  (0 0; 768 911).
    >
    > I'm not setting this anywhere and setting  UITableView.frame back to CGRectMake(0, 313, 768, 598) doesn't do anything on viewDidLoad or viewWillAppear.
    >
    > Can anyone point out what I'm missing or doing wrong and why this is resizing to full screen in the first place??
    >
    > Thanks in advance,
    > - Alex Zavatone
previous month july 2012 next month
MTWTFSS
            1
2 3 4 5 6 7 8
9 10 11 12 13 14 15
16 17 18 19 20 21 22
23 24 25 26 27 28 29
30 31          
Go to today