Problem in scrolling a view

Discussion in 'iOS Programming' started by iphonejudy, Dec 18, 2008.

  1. macrumors 6502

    iphonejudy

    Joined:
    Sep 12, 2008
    #1
    Hi,

    I use IB.


    First i create a view and add some controls in the top and bottom.

    I change the view to scrollview.

    I need to display some labels in the middle of the view.

    so i add a new view.

    I need to scroll the view.

    Here my code


    HTML:
    IBOutlet UIScrollView *scroll;
    IBOutlet UIView *view1;
    
    @property(nonatomic,retain) UIScrollView *scroll;
    @property(nonatomic,retain) UIView *view1;
    
    
    [scroll addSubview:view1];
    	[scroll setScrollEnabled:YES];
    	[scroll setContentSize:CGSizeMake(200,200)];
    	scroll.showsVerticalScrollIndicator=YES;
    	scroll.showsHorizontalScrollIndicator=YES;
    
    My problem is the view is not scrolled.
    I could not see any scrollbar indicator.

    What is the mistake i done?
    Can anybody please tell me the solution?

    Thanks
    judy
     
  2. macrumors 6502a

    Joined:
    Oct 24, 2008
    Location:
    Cambridge
  3. thread starter macrumors 6502

    iphonejudy

    Joined:
    Sep 12, 2008
    #3
  4. macrumors 6502a

    Joined:
    Oct 24, 2008
    Location:
    Cambridge
    #4
    From the documentation:

    i.e. scrollbars will only be visible when you are scrolling.
     
  5. thread starter macrumors 6502

    iphonejudy

    Joined:
    Sep 12, 2008
    #5


    Thank you jinc.its working.
     

Share This Page