views:

23

answers:

0

Hi,I want to use a very large segmentedcontrol component so i had the idea to make it in a uiscrollview ..so by scrolling horizontally user can choose the appropriate item . i wrote this code:

  CGRect     rect = [[UIScreen mainScreen] applicationFrame];
 CGRect frame = CGRectMake(rect.origin.x + kLeftMargin, rect.size.height - kPaletteHeight - kTopMargin, 2*rect.size.width , kPaletteHeight);
 seg.frame = frame;

 scroll.frame=frame;
 scroll.contentSize = CGSizeMake(frame.size.width * 2,frame.size.height);
    scroll.showsHorizontalScrollIndicator = YES;
    scroll.showsVerticalScrollIndicator = NO;
 scroll.scrollsToTop = NO;
 [scroll addSubview:seg];

but the scroll view didn't let the segmentedcontrol to be seen. where was my mistake?thks