问题描述
在顶部有UIImageView
,在其下面有UITextView
.我希望UITextView
扩展到上方站点,并在用户开始滚动后覆盖UIImageView
.
in my iPhone Application I have a UIImageView
on the top and a UITextView
below that. I want the UITextView
to expand to the upper site and cover the UIImageView
once the User starts scrolling.
在Rdio应用程序中可以找到类似的效果.在那里,您可以在顶部查看封面,而在下面可以查看即将到来的标题,一旦用户开始滚动,即将到来的标题视图就会展开并覆盖封面.
A similar effect can be found in the Rdio Application. There you can view the cover on the top and the upcoming title below, once the user starts to scroll, the upcoming titles view expands and covers the cover.
那怎么办?
谢谢.
推荐答案
尝试使用UIScrollView的委托方法之一(UITextView是UIScrollView的子视图).
Try to use one of the delegate methods of UIScrollView (UITextView is a subview of UIScrollView).
这应该对您有用:
- (void)scrollViewWillBeginDragging:(UIScrollView *)scrollView
// From Apple Docs: Tells the delegate when the scroll view is about to start scrolling the content.
实施此方法并在其中调用您的大小调整功能.
Implement this method and call your resizing function in it.
这篇关于iPhone:滚动时展开UITextView的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!