开发者

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(@" wi开发者_开发知识库i this is cool:%@",detaildesc);            
     [self.view addSubview:tit];


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


}

    return self;
   }

how to add a vertical scrollview


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.


In contentSize you have to increase the Y value

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜