質問

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