ListView控件捏到变焦可能吗? [英] ListView pinch-to-zoom possible?

查看:143
本文介绍了ListView控件捏到变焦可能吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想实施包含小块code的一个ListView捏到变焦。不过,我似乎无法得到它的工作。我怀疑这可能是不可能实现的一个ListView多点触控缩放。我目前已经使用这个实现:
<一href=\"http://www.allappsdevelopers.com/TopicDetail.aspx?TopicID=c16ed3b4-b422-43ba-b595-ee8e21dd1854\" rel=\"nofollow\">http://www.allappsdevelopers.com/TopicDetail.aspx?TopicID=c16ed3b4-b422-43ba-b595-ee8e21dd1854

I'm trying to implement pinch-to-zoom on a ListView which contains small pieces of code. However, I can't seem to get it to work. I suspect it may be not possible to implement multitouch zoom on a ListView. I currently have used this implementation: http://www.allappsdevelopers.com/TopicDetail.aspx?TopicID=c16ed3b4-b422-43ba-b595-ee8e21dd1854

我的目标是Android 2.2以上版本。
有没有人有捏到变焦的一个例子放大和缩小的文字?
或者它只是没有能够有效地做它一个ListView?

My target is Android 2.2+. Does anyone have an example of pinch-to-zoom to zoom in and out on the text? Or is it just not possible to do it effectively on a ListView?

我想我有code,但它是在上面的例子类似。

I would include my code, but it's similar to that in the above example.

感谢。

推荐答案

使用实施捏此code 任何自定义视图-to-变焦。

Use this code for implementing pinch-to-zoom on any custom view.

和确保ListView控件响应所有的事件,而不是只捏姿态,覆盖的 onTouchEvent() 通过以下方式让 ScaleGestureDetector 检测/处理所有的事件。

And to make sure that the ListView responds to all the events and not only the pinch gesture, override onTouchEvent() in the following way to let the ScaleGestureDetector detect/handle all the events.

@Override
public boolean onTouchEvent(MotionEvent e) {
    myScaleDetector.onTouchEvent(e);
    return super.onTouchEvent(e);
}

这篇关于ListView控件捏到变焦可能吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆