我要给它包含按钮和TextView的。什么我想要的是垂直滚动视图...反刍能跟大家帮我出下面是代码...如何添加一个垂直滚动视图
- (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;
}
我已经添加uiscroll视图在界面builder.I中号不能dat..could后进行û修改去上面的代码.... – kingston
@kingston,如果你有一个带有nib的uiviewcontroller,删除视图,添加一个uiscrollview,将uiscrollview作为uiviewcontroller的视图链接,然后在viewDidLoad中添加下面的代码:self.scrollView.contentSize = CGSizeMake(320,500);其中500将是整个事物的总高度。 – Jano
我添加上面的行即时通讯得到一个错误,说scrollView未声明..如果我添加滚动视图作为IBoutlet和链接查看,即使这并不工作 – kingston