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);
有帮助吗?

解决方案

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].

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top