Question

How can I add imageView as subView to imageView to it content end ? And I need to add offset of imageView in its content size

My code not works

 imageView.frame = CGRectMake(0, imageView.subviews.count * _mageView.frame.size.height + _imageView.frame.origin.y , _screenWidth, _image.size.height);
Was it helpful?

Solution

To answer the second question first, you might look at CGRectOffset(CGRect rect, x, y) where rect is the original rectangle and x and y are the values by which the new rectangle is offset from the original rectangle. You can use this statement to define the value of imageView.frame.

For the first question, add the imageView as a subView of the mainView: [mainView addSubview:imageView].

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top