display the data as it is displayed in the screen
<p><img src="http://i.stack.imgur.com/VbZ4e.png" alt="enter image description here"></p>

<p>Hi, I want to implement a screen like in the image above. The data is coming from the server in the form of JSON string and I have parsed the data.</p>

<p>The code is as follows:</p>

<pre><code>         UILabel *lblTitle  = [self createDynamicLabel:@"Seroquel"
                                           contentFrame:CGRectMake(10, 5, 150, 20) 
                                                  color:[UIColor blackColor] 
                                                   font:[UIFont fontWithName:@"Arial-BoldMT" size:17]];
        [scrollview addSubview:lblTitle];
        [lblTitle release];

        UILabel *lblGeneric       = [self createDynamicLabel:@"Generic Name:"
                                             contentFrame:CGRectMake(10, lblTitle.frame.size.height+5, 130, 20) 
                                                    color:[UIColor blackColor] 
                                                     font:[UIFont fontWithName:@"Arial-BoldMT" size:17]];
        [scrollview addSubview:lblGeneric];
        [lblGeneric release];

        UILabel *lblGenericName   = [self createDynamicLabel:DrugInfo.GenName
                                                contentFrame:CGRectMake(lblGeneric.frame.size.width+5, 24, 150, 20) 
                                                       color:[UIColor blackColor] 
                                                        font:[UIFont fontWithName:@"Arial-BoldMT" size:17]];
        [scrollview addSubview:lblGenericName];
        [lblGenericName release];

        UILabel *lblManufacturer  = [self createDynamicLabel:@"Manufacturer:"
                                                contentFrame:CGRectMake(10, 44, 115, 20) 
                                                       color:[UIColor blackColor] 
                                                        font:[UIFont fontWithName:@"Arial-BoldMT" size:17]];
        [scrollview addSubview:lblManufacturer];
        [lblManufacturer release];

        UILabel *lblManufacturerName = [self createDynamicLabel:DrugInfo.Mtr
                                                   contentFrame:CGRectMake(115, 43, 150, 20) 
                                                          color:[UIColor blackColor] 
                                                           font:[UIFont fontWithName:@"Arial-BoldMT" size:17]];
        [scrollview addSubview:lblManufacturerName];
        [lblManufacturerName release];

        //[self createDynamicView:CGRectMake(10, 70, 153, 128)];


        UILabel *lblCommon          = [self createDynamicLabel:@"Common uses:"
                                           contentFrame:CGRectMake(10, 209, 110, 20) 
                                                  color:[UIColor blackColor] 
                                                   font:[UIFont fontWithName:@"Arial-BoldMT" size:17]];
        lblCommon.backgroundColor   = [UIColor whiteColor];

        [lblCommon sizeToFit];
        [scrollview addSubview:lblCommon];
        [lblCommon release];

        NSString *genericInfo       = [NSString stringWithFormat:@"                        %@",DrugInfo.ComUse];
        UILabel *lblCommonUse       = [self createDynamicLabel:genericInfo
                                             contentFrame:CGRectMake(10, 208, 310, 80) 
                                                    color:[UIColor blackColor] 
                                                     font:[UIFont fontWithName:@"Arial-BoldMT" size:17]];


        //[lblCommonUse sizeToFit];
        lblCommonUse.lineBreakMode  = UILineBreakModeWordWrap;
        lblCommonUse.numberOfLines  = 0;
        [scrollview addSubview:lblCommonUse];
        [lblCommonUse release];



        UILabel *lblBefore          = [self createDynamicLabel:@" Before Using:"
                                           contentFrame:CGRectMake(10, 294, 102, 20) 
                                                  color:[UIColor blackColor] 
                                                   font:[UIFont fontWithName:@"Arial-BoldMT" size:17]];
        [lblBefore sizeToFit];
        lblBefore.backgroundColor   = [UIColor whiteColor];
        [scrollview addSubview:lblBefore];
        [lblBefore release];

        genericInfo                 = [NSString stringWithFormat:@"                        %@",DrugInfo.BeforeUse];
        UILabel *lblBeforeUse       = [self createDynamicLabel:genericInfo
                                             contentFrame:CGRectMake(10, 290, 308, 120) 
                                                    color:[UIColor blackColor] 
                                                     font:[UIFont fontWithName:@"Arial-BoldMT" size:17]];
        lblBeforeUse.lineBreakMode  = UILineBreakModeWordWrap;
        lblBeforeUse.numberOfLines  = 0;
        [scrollview addSubview:lblBeforeUse];
        [lblBeforeUse release];


    }  
}
}   


-(UILabel *)createDynamicLabel:(NSString *)setTitle 
              contentFrame:(CGRect)labelFrame 
                     color:(UIColor *)labelColor 
                      font:(UIFont *)labelFont {

UILabel  *dynamicLabel = [[UILabel alloc] init];
dynamicLabel.frame     = labelFrame;
dynamicLabel.text      = setTitle;
dynamicLabel.textColor = labelColor;
dynamicLabel.font      = labelFont;
dynamicLabel.backgroundColor = [UIColor clearColor];
return dynamicLabel;
}
</code></pre>

<p>But if the data is more than can be displayed on the screen, it is clipping it and I want to display all the data. Can any one please help me do that?</p>

<p>Thanks in advance.</p>
