kingston
kingston

Reputation: 1553

how to add a vertical scrollview

i ve got a view which contains buttons and textview .what i want is to scroll vertically...cud u guys help me out below is the code...

- (id)initWithItem:(NSString *)theItem Title:(NSString *)title Description:(NSString *)detaildesc{
if (self = [super initWithNibName:@"Secondetailview" bundle:nil]) {
self.theItem1=theItem;
    self.theTitle=title;

    UILabel *tit = [[[UILabel alloc] initWithFrame:CGRectMake(10, 10, 200, 25)] autorelease];                        
    [tit setBackgroundColor:[UIColor clearColor]];
    [tit setTextColor:[UIColor whiteColor]];
    [tit setText:self.theTitle];  
    [tit setFont:[UIFont boldSystemFontOfSize:16]];
    NSLog(@" wii this is cool:%@",detaildesc);            
     [self.view addSubview:tit];


    label1.text=detaildesc;
    label1.numberOfLines=4;
    label1.textColor=[UIColor grayColor];


}

    return self;
   }

enter image description here

Upvotes: 0

Views: 795

Answers (2)

Tendulkar
Tendulkar

Reputation: 5540

In contentSize you have to increase the Y value

Upvotes: 0

TheLearner
TheLearner

Reputation: 19507

Put a UIScrollview inside the tab and then adjust the contentSize of the UIScrollView to the size of the total height of all your controls.

Upvotes: 1

Related Questions