Large UIView inside a scrollview

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

  1. chhoda macrumors 6502

    Joined:
    Oct 25, 2008
    #1
    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 !

    Code:
      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);
    regards

    ----------

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

    Joined:
    Dec 7, 2009
    Location:
    UK
    #2
    16384 happens to be 16Kb, I guess this has something to do with it?
     
  3. PhoneyDeveloper macrumors 68030

    PhoneyDeveloper

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

Share This Page