Note that there are some explanatory texts on larger screens.

plurals
  1. POHow to add A scrollView for vertical scrolling allong with labels
    text
    copied!<p>I want add UIScrollView with label and make it scroll vertical if i have more labels i am adding following code but it is not scrolling. I have more 5 labels to add in it also.</p> <p>In Header file</p> <pre><code>IBOutlet UIScrollView*scrollView; @property(nonatomic,retain) IBOutlet UIScrollView*scrollView; </code></pre> <p>In implementation file in viewDidLoad</p> <pre><code> titleLabel = [[UILabel alloc ] initWithFrame:CGRectMake(892,257,206,84)]; titleLabel.textAlignment = UITextAlignmentRight; titleLabel.textColor = [UIColor blackColor]; titleLabel.font = [UIFont fontWithName:@"Helvetica" size:14]; [scrollView addSubview:titleLabel]; titleLabel = [[UILabel alloc ] initWithFrame:CGRectMake(10,20,206,84)]; titleLabel.textAlignment = UITextAlignmentRight; titleLabel.textColor = [UIColor blackColor]; titleLabel.font = [UIFont fontWithName:@"Helvetica" size:14]; [scrollView addSubview:titleLabel]; titleLabel1 = [[UILabel alloc ] initWithFrame:CGRectMake(10,110,206,84)]; titleLabel1.textAlignment = UITextAlignmentRight; titleLabel1.textColor = [UIColor blackColor]; titleLabel1.font = [UIFont fontWithName:@"Helvetica" size:14]; titleLabel1.text=@"tilte Working Fine"; [scrollView addSubview:titleLabel1]; titleLabel2 = [[UILabel alloc ] initWithFrame:CGRectMake(10,190,206,84)]; titleLabel2.textAlignment = UITextAlignmentRight; titleLabel2.textColor = [UIColor blackColor]; titleLabel2.text=@"tilte Working Fine"; titleLabel2.font = [UIFont fontWithName:@"Helvetica" size:14]; [scrollView addSubview:titleLabel2]; titleLabel3 = [[UILabel alloc ] initWithFrame:CGRectMake(10,270,206,84)]; titleLabel3.textAlignment = UITextAlignmentRight; titleLabel3.textColor = [UIColor blackColor]; titleLabel3.font = [UIFont fontWithName:@"Helvetica" size:14]; titleLabel3.text=@"tilte Working Fine"; [scrollView addSubview:titleLabel3]; titleLabel4 = [[UILabel alloc ] initWithFrame:CGRectMake(10,360,206,84)]; titleLabel4.textAlignment = UITextAlignmentRight; titleLabel4.textColor = [UIColor blackColor]; titleLabel4.font = [UIFont fontWithName:@"Helvetica" size:14]; titleLabel4.text=@"tilte Working Fine"; [scrollView addSubview:titleLabel4]; titleLabel5 = [[UILabel alloc ] initWithFrame:CGRectMake(10,450,206,84)]; titleLabel5.textAlignment = UITextAlignmentRight; titleLabel5.textColor = [UIColor blackColor]; titleLabel5.font = [UIFont fontWithName:@"Helvetica" size:14]; titleLabel5.text=@"tilte Working Fine"; [scrollView addSubview:titleLabel5]; titleLabel6 = [[UILabel alloc ] initWithFrame:CGRectMake(10,530,206,84)]; titleLabel6.textAlignment = UITextAlignmentRight; titleLabel6.text=@"tilte Working Fine"; titleLabel6.textColor = [UIColor blackColor]; titleLabel6.font = [UIFont fontWithName:@"Helvetica" size:14]; [scrollView addSubview:titleLabel6]; </code></pre>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload