[Solved] Scrollview content center alignment in iOS app [closed]

I will give u a HINT: Take the scrollView’s bounds, get midX, say X1. Take all the visible button’s frames, and then their frame’s midX, say X2’s. Calculate absolute differences, between X1 and X2’s, whichever button has the smallest one, scroll the scrollview to that button’s frame. Have Fun. Cheers 1 solved Scrollview content center … Read more

[Solved] Expected ‘:’ Lexical or Preprocessor error

It looks like you are missing a colon, a couple of dots, and a couple of semicolons: [self.ScrollView setScrollEnabled:YES]; // ^ ^ ^ [self.ScrollView setContentSize:CGSizeMake(320, 900)]; // ^ ^ You need to watch out for these small elements of the syntax – Objective C does not tolerate deviations. The worst part about syntax errors is … Read more

[Solved] how to have UIImage below UILabel or UITextView in a scrollview

You must implement your UIScrollView and then add the desired subview (UIImageView and UILabel in your case). In you viewDidLoad: UIScrollView *scrollView = [[UIScrollView alloc] initWithFrame:CGRectMake(0, 0, self.view.frame.size.width, self.view.frame.size.height)]; scrollView.backgroundColor = [UIColor redColor]; UIImageView *imageView = [[UIImageView alloc] initWithFrame:CGRectMake(0, 0, scrollView.frame.size.width * 2, 100)]; imageView.backgroundColor = [UIColor blueColor]; UILabel *label = [[UILabel alloc] initWithFrame:CGRectMake(imageView.frame.size.width, 0, … Read more