zoukankan      html  css  js  c++  java
  • [翻译] BKZoomView

    BKZoomView

    https://github.com/freshking/BKZoomView

    A UIView that will zoom into its parent view. It can be implemented with only three lines of code and is very easy to use. It is optionally drag-able with a customizable zoom scale.

    一个UIView,用来放大它的父类view,非常容易使用,仅需3行代码。支持拖动这个view,并定制缩放比例。

    How to

    Initialize the zoom view anywhere in a view.

    在一个view中初始化一个区域。

    BKZoomView *zoomView = [[BKZoomView alloc] initWithFrame:CGRectMake(0, 280, self.view.frame.size.width, 150)];
    [zoomView setZoomScale:2.0];
    [zoomView setDragingEnabled:NO];
    [self.view addSubview:zoomView];
    

    Options:

    1. setZoomScale: Here you can set the zoom value (Standard = 2.0) 设置放大区域(默认值为2.0)
    2. setDragingEnabled: Here you can decide wether the user can drag the zoom view around or if it is static. If static, then the user can touch throuch this view which is nice if you place it over a UITableView and still want to scroll. 设置是否可以拖动:在这里,你可以设置用户是否可以拖动这个view,你也可以设置成静态的。

    Important:

    [zoomview setNeedsDisplay] must be called everytime you want to update the zoom view. For example the zoom view is placed over a UITableView and you want a live zoom when scrolling, then you must implement this in the scrollViewDidScroll: method. Exception here is when dragging.

    [zoomview setNeedsDisplay]在你更新缩放view的时候必须每次都调用。如果在scrollView中调用的话,你在scrollViewDidScroll:方法中调用就行了。

    For further information please check out the example application.

    更多的信息,请检查demo项目工程。

  • 相关阅读:
    荷兰国旗问题
    读取文件中数据到数组
    从五个球中选出3个枚举的简单运用
    搜索算法总结
    匿名对象
    欧几里得距离C++代码实现
    用递归法吧字符串S倒序
    利用系统来完成十进制,十六进制,八进制的转换
    DBHelper 使用的是存储过程
    DBHelper的一个小例子
  • 原文地址:https://www.cnblogs.com/YouXianMing/p/3997711.html
Copyright © 2011-2022 走看看