[英]Resizing UIImageview with a UITextview using UIGuesture
I'm new in Iphone.我是 Iphone 的新手。 I have an
UITextView
inside a UIImageView
.我在
UIImageView
中有一个UITextView
。 Now I need to dynamically resize the UIImageView
so that its textview also change its size dynamically.现在我需要动态调整
UIImageView
的大小,以便它的 textview 也动态改变它的大小。 Moreover I can move this UIImageView
with UITextView
around the screen.此外,我可以用
UITextView
在屏幕上移动这个UIImageView
。 If any one knows this using UIGuesture
please help me.如果有人使用
UIGuesture
知道这一点,请帮助我。
Any help would be appreciated任何帮助,将不胜感激
UIImageView
object, look at the UIPinchGestureRecognizer
.UIImageView
object 的大小,请查看UIPinchGestureRecognizer
。 It will have a property called scale
that you can use to change its size.scale
的属性,您可以使用它来更改其大小。UITextView
object that is the subview, you can look at autoresizingMask
property inherited from UIView
.UITextView
object,您可以查看从UIView
继承的autoresizingMask
属性。 Set it appropriately so that the text view scales in response to its super view.UIPanGestureRecognizer
.UIPanGestureRecognizer
。 You can get the translation using translationInView:
.translationInView:
获取翻译。 Use this to modify the center of the image view object. I hope you've gone through the guide
.我希望你已经阅读了
guide
。 Let us know if you face problems implementing this and put some code so that we can guide you in the right direction.如果您在实现此功能时遇到问题,请告诉我们并添加一些代码,以便我们可以引导您朝着正确的方向前进。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.