自定义textview在Android中具有旋转,放大,缩小和触摸移动的功能? [英] Custom textview with rotate, zoom in,zoom out and move on touch in android?

查看:1025
本文介绍了自定义textview在Android中具有旋转,放大,缩小和触摸移动的功能?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

任何好友都有自定义文本视图",其中包含旋转",放大",缩小"和像这样移动功能,例如MutiTouch图像视图 http://judepereira.com/blog/multi-touch-in-android-translate-scale-and-rotate/在Android中? 我想要这样的屏幕截图. 1.在该屏幕上绘制简单的文本. 2.在该屏幕上,当我缩放此视图时,文本自动换行. 3.在该屏幕上,在视图上移动文本. 4.在该屏幕中,旋转文本. 所有这些功能都可以在TextView touch上完成.

Any buddy have Custom Text View with Rotate, Zoom In, Zoom Out & Move functionality like MutiTouch Image View like this http://judepereira.com/blog/multi-touch-in-android-translate-scale-and-rotate/ in android? I Want exactly like this screen shots. 1. In that screen draw simple text. 2. In that screen when i zoom this view Text auto wrap. 3. In that screen Move Text on view. 4. In that screen Rotate Text. This all functionality do on TextView touch.

推荐答案

我使用了 https://github.com/jcmore2/Collage 实现旋转的textview

I used https://github.com/jcmore2/Collage to achieve a rotated textview

但是我更改了整个代码,因为该插件可以处理图像 CardView扩展了ImageView 我选择了 MyCardView扩展RelativeLayout ,然后删除了所有与图像有关的代码 而不是使用 collage.createCollageResources(listRes);
我在自己的 CollageView

but i changed the whole code since the plugin works with images CardView extends ImageView i chnaged to MyCardView extends RelativeLayout then removed all the code related to images and instead of using collage.createCollageResources(listRes);
i created my own function in my own CollageView class

public void createCollage(List<MyCardView> list) {
    for (MyCardView layout : list) {
        addCard(layout);
    }
}

现在,您可以在活动"中向拼贴视图添加一个完整的RelativeLayout,其中不仅包含图片,还包含其他孩子

Now in the Activity you can add to the collageview a complete RelativeLayout with it's children not just images

这也将允许处理单个视图或多个.. TextView或其他任何东西..最后,这将使视图不仅旋转,而且可以通过多点触摸手势进行拖动和缩放.

this also will allow dealing with single view or multiple .. TextView or any thing else .. finally this will make the view not just rotated but dragged and zoomed with multi touch gesture.

这篇关于自定义textview在Android中具有旋转,放大,缩小和触摸移动的功能?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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