title: How to create UIScrollview programmatically
body: <p>I have a class that subclasses UIView(no xib file). I am drawing images and lines in the view by overriding the drawRect method. </p>
  
  <pre><code>- (void)drawRect:(CGRect)rect {
  UIImage *image1 = [UIImage imageNamed:@"PinDown1.png"];
  for(int i =1; i&lt;20; i++){
  CGPoint drawPointOne = CGPointMake(40.0f * i, 40.0f); 
  [image1 drawAtPoint:drawPointOne];
  }
  </code></pre>
  
  <p>I need to add a scrollview to this view. I have tried creating a scrollview and setting the contentsize. But its not working. I am getting it wrong somewhere. Need some help.</p>
  
  <p>Edit:</p>
  
  <p>I subclassed UIScrollview and added the following code. But still, it doesn't seem to work.</p>
  
  <pre><code>[self setContentSize:CGSizeMake(800,758)];
  self.showsHorizontalScrollIndicator = YES;
  self.showsVerticalScrollIndicator = YES;
  self.pagingEnabled = YES;
  </code></pre>