Large UIView inside a scrollview

Discussion in 'iOS Programming' started by chhoda, Apr 16, 2012.

  1. chhoda macrumors 6502

    Oct 25, 2008
    I am trying to fit a large width UIView inside a scroll view. 87600 to be precise.

    when i do this, the view seems to disappear, but when i hard code the width to 1200 it appears, why is it so ? is there a max width for a view ?

    i am setting the contentview size, and it seems to work though !

      CGRect rect = sv.frame;
        int rectwidth = rect.size.width / kMaxColsPerWindow;
        rect.size.width = rectwidth * count;
        [sv setContentSize:rect.size];
        rect.origin.x = 0;
        rect.origin.y = 0;
        viewLarge.frame = CGRectMake(0, 0, rect.size.width, rect.size.height);


    with a bit trial and error i discovered that width 16384 works fine but 16385 makes it disappear !
  2. nathanlloyd macrumors member

    Dec 7, 2009
    16384 happens to be 16Kb, I guess this has something to do with it?
  3. PhoneyDeveloper macrumors 68040


    Sep 2, 2008
    Look at tiling and CATiledLayer. That's how this is supposed to be done.

Share This Page