6
低於我的UIScrollView沒有橫向滾動,請幫我在這裏..的UIScrollView不滾動水平
FirstView = [[UIView alloc] initWithFrame:CGRectMake(60, 0, 100, 150)];
[FirstView setBackgroundColor:[UIColor clearColor]];
SecondView = [[UIView alloc] initWithFrame:CGRectMake(320+60, 0, 100, 150)];
[SecondView setBackgroundColor:[UIColor clearColor]];
HolderView = [[UIView alloc]initWithFrame:CGRectMake(0, 0, 1000, 150)];
scrHorizontalScroll = [[UIScrollView alloc]initWithFrame:HolderView.frame];
[scrHorizontalScroll setBackgroundColor:[UIColor redColor]];
[scrHorizontalScroll setContentSize:CGSizeMake(999, 150)];
[scrHorizontalScroll setScrollEnabled:YES];
[HolderView addSubview:scrHorizontalScroll];
[scrHorizontalScroll addSubView:FirstView]; [scrHorizontalScroll addSubView:SecondView]; [HolderView addSubView: scrHorizontalScroll];
的HolderView沒有水平滾動,但它發生了,請大家幫忙
注:我有一個MAINVIEW根據框架座標在其頂部添加HolderView。
[mainView addSubView:label].... [mainView addSubView:HolderView];
這是完整結構
非常感謝湯姆,你太棒了。 – Futur 2010-05-01 22:56:12