码迷,mamicode.com
首页 > 其他好文 > 详细

[翻译] AnchoredFloatView

时间:2015-02-15 21:46:15      阅读:189      评论:0      收藏:0      [点我收藏+]

标签:

AnchoredFloatView

技术分享

Float View over TableView to indicate selected row direction

Float View 可以用来指示 TableView 中被选择的cell.

This is a Float View to indicate the direction and quickly scroll up or down to the TableView selected Row.

Float View 这是用来标示选中的cell,点击它后可以快速的移动到被选中cell上.

It basically consists of a custom UILabel with one fixed UIImageView inside it, on the left.

Float View 是由自定义的UILabel与一个左侧固定的UIImageView组成的.

 

 技术分享

 

Features

  • automatically update label frame and align it on TableView bottom center 自动更新label的frame值并居中
  • quickly scroll up or down the tableView to the selected row on click 点击后快速移动到之前你选中的cell上
  • nice splash animation 华丽的移动动画
  • rotation compatible 兼容横竖屏

 

Installation

Grab the files in View/AnchoredFloatView and put it in your project. The code uses ARC, so make sure to turn that on for the files if you‘re not already using ARC.

将AnchoredFloatView拖到你的项目当中.这份代码是由ARC,所以,你要确保切换到ARC上去.

 

Usage

import the header class on your tableViewController:

将以下头文件导入你的项目当中:

#import "AnchoredFloatView.h"

alloc/init the view on viewDidLoad passing tableView and the indexPath of the selectedRow by parameter:

初始化view,然后将tableView与被选中的indexPath传递给这个view:

AnchoredFloatView *floatView = [[AnchoredFloatView alloc] initWithTableView:self.tableView andTargetIndexPath:self.targetIndexPath];
[self.view addSubview:floatView];

 

Small Print

License

AnchoredFloatView is released under the MIT license.

AnchoredFloatView遵循MIT协议.

Author

Carlos Arantes (@carantes)

 

[翻译] AnchoredFloatView

标签:

原文地址:http://www.cnblogs.com/YouXianMing/p/4293481.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!