pinch

Swift开发:仿Clear手势操作(拖拽、划动、捏合)UITableView

大兔子大兔子 提交于 2020-04-17 03:32:26
【推荐阅读】微服务还能火多久?>>> 这是一个完全依靠手势的操作ToDoList的演示,功能上左划删除,右划完成任务,拖拽调整顺序,捏合张开插入。 项目源码: https://github.com/luan-ma/ClearStyleDemo.Swift 初始化 TDCToDoItem.swift 定义模型对象 TDCToDoListController.swift 继承自 UITableViewController, 演示UITableView操作 var items = [ TDCToDoItem(text: "Feed the cat"), TDCToDoItem(text: "Buy eggs"), TDCToDoItem(text: "Pack bags for WWDC"), TDCToDoItem(text: "Rule the web"), TDCToDoItem(text: "Buy a new iPhone"), TDCToDoItem(text: "Find missing socks"), TDCToDoItem(text: "Write a new tutorial"), TDCToDoItem(text: "Master Objective-C"), TDCToDoItem(text: "Remember your wedding anniversary

Scale of UIPinchGestureRecognizer in horizontal and vertical directions separately

女生的网名这么多〃 提交于 2020-01-22 13:48:06
问题 When using UIPinchGestureRecognizer what is the best way to detect/read the pinch scale in horizontal and vertical directions individually? I saw this post UIPinchGestureRecognizer Scale view in different x and y directions but I noticed there were so many going back and forth for such a seemingly routine task that I am not sure that is the best answer/way. If not using UIPinchGestureRecognizer altogether for this purpose is the answer, what's the best way to detect pinch scale in two

UIPinchGestureRecognizer's touch locations

假如想象 提交于 2020-01-05 03:29:24
问题 I want to implement zooming with pinch gesture in my iphone app. The problem is, in a method that gets called when the gesture is recognized I don't have access to the touch events themselves (so I can't really get their locationInView: ) and I would like to get it in order to center my zoom-in properly. In the UIPinchGestureRecognizer class definition there is a UITouch *_touches[2]; defined, but I can't access it from outside of the class. Is there anything I can do in order to get that

Implementing a Gallery with pinch zoom

泄露秘密 提交于 2020-01-03 05:36:52
问题 I have a gallery of images and I'm trying to enable pinch zoom on it. Separately, they work just fine. The problem is, I can't for the life of me bind the two of them together! I tried to bind the ImageZoomView in the ImageAdapter, to no avail. Should I try doing it when the user clicks the image? Does anyone have any other ideas? This is the code in ImageAdapter.class that returns the gallery elements: public View getView(int position, View convertView, ViewGroup parent) { ImageView i = new

Pinch zoom in android 2.1

前提是你 提交于 2020-01-02 06:43:10
问题 Is there a way we can achieve Pinch zoom ability to the imageview? 回答1: Following code works great! You just have to copy and paste: import android.content.Context; import android.graphics.Bitmap; import android.graphics.Canvas; import android.graphics.Matrix; import android.graphics.Paint; import android.graphics.PointF; import android.os.Handler; import android.util.AttributeSet; import android.util.FloatMath; import android.util.Log; import android.view.GestureDetector; import android.view

UIPinchGestureRecognizer Scale view in different x and y directions

旧街凉风 提交于 2020-01-01 16:37:13
问题 i don't want to use the scale as classic zoom, instead i want to change the form of quadrates to a rectangle for example. After a lot of trying i'm that far that my fingers are the corners of the rectangle. So but if i start a new pinch gesture inside my view gets smaller to my fingers instead of getting bigger like the normal scale does. if ([gestureRecognizer numberOfTouches] >1) { //getting width and height between gestureCenter and one of my finger float x = [gestureRecognizer

Detecting pinch in Android

大城市里の小女人 提交于 2020-01-01 08:24:30
问题 I would like to handle pinch events in my Android application to zoom in and out. I believe Android 2.0 has multi-touch functionality, and heard that Android 1.6 might or might not support it depending of the device. What's the best way to detect pinch events, while degrading gracefully for devices that don't support it? I'm targeting Android 1.5 upwards. 回答1: A great article by Ed Burnette (Hello Android Author) on multi touch (including pinch zoom) can be found here: http://www.zdnet.com

How can i enable pinching and stretching on my app's UI

房东的猫 提交于 2019-12-25 06:55:28
问题 I've a table layout with a textview in it. As the texts within every row are small enough to fit into the screen, I want my users to be able to pinch and stretch the screen so that they can zoom in. But, currently that feature is not working by default. How can i enable pinching and stretching the screen, then? Thanks 回答1: You can implement it yourself. Start by reading this multipart tutorial: http://www.zdnet.com/blog/burnette/how-to-use-multi-touch-in-android-2/1747 (part 6 is devoted to

Zooming in android - keep image in view

回眸只為那壹抹淺笑 提交于 2019-12-23 09:47:19
问题 I know there are tons of threads on actually getting pinch zoom implemented - but I got this far already. I'm using SimpleScaleGestureListener to handle the pinching. I've managed to make sure you can't zoom out farther than to keep the image height the same as the screen size (so you're image height will always be at least the height of the available screen size). However, I'm looking for a way to automatically detect if the image is being panned outside of these boundaries. Just like the

Framework7: How to get pinch to zoom on page-content with hammer.js?

旧街凉风 提交于 2019-12-23 05:43:30
问题 I would like to use pinch to zoom on page-content. I tried this in myapp.js but it still does not work. Did i forget something? jquery, hammer js and jquery hammer js (wrapper) are initialized var mc = $(".page-content").hammer(); mc.add(new Hammer.Pinch({ threshold: 0 })); 回答1: There are two problems in your question: How to handle pinch with hammer How to properly zoom using Javascript + CSS I posted an answer to a similar question about zooming in Javascript + CSS (which is your problem #2