How to create a horizontal scroll view at the top like a scrolling menu having many buttons (example : 20 buttons) ? Please help !
I am using following code :
CGRect buttonFrame = CGRectMake(0.0f, 0.0f, scrollView.frame.size.width, scrollView.frame.size.height);
for (NSString *text in wordsArray) {
UIButton *button = [[UIButton alloc]initWithFrame:buttonFrame];
button.text = text;
[scrollView addSubview:button];
buttonFrame.origin.x +=buttonFrame.size.width;
}
CGSize contentSize = scrollView.frame.size;
contentSize.width = buttonFrame.origin.x;
scrollView.contentSize = contentSize;
But not getting what i want.