PTEHorizontalTableView
Horizontal UITableView inspired by EasyTableView.
水平滚动的UITableView,灵感来自于EasyTableView.
Features - 特点
- PTEHorizontalTableView wraps a
UITableView
rotated horizontally using aCGAffineTransform
whose cells' content views are rotated back vertically. PTETableViewDelegate
very similar to the standardUITableViewDelegate
with some method name such astableView:widthForCellAtIndexPath:
.- Support for standard scroll indicators, headers and footers.
- Full Interface Builder support including creating Static/Prototype Cells using Storyboards.
- PTEHorizontalTableView封装了一个UITableView,用CGAffineTransform在水平方向上进行了旋转,然后,它的cell的contentView经过了垂直方向的旋转后就又恢复正常显示了.
- PTETableViewDelegate的代理方法与UITableViewDelegate的代理方法非常相似,你可以很方便的就能使用
- 支持标准的指示器,headerViews以及footerViews.
- 支持IB创建,或者是Storyboard创建.
Demo - 示例
A demo project is included in the repository.
你可以参考demo来了解使用方法.
Installation - 安装
Simply add pod 'PTEHorizontalTableView'
to your CocoaPods' Podfile.
你只需要在你的CocoaPods的Podfile中加入以下一句话即可.
platform :ios, '5.0'
pod 'PTEHorizontalTableView'
Documentation - 文档
http://cocoadocs.org/docsets/PTEHorizontalTableView/
Usage - 使用
Simply implement the PTETableViewDelegate
protocol:
你需要实现代理方法PTETableViewDelegate即可:
@protocol PTETableViewDelegate <NSObject>
- (NSInteger)tableView:(PTEHorizontalTableView *)horizontalTableView
numberOfRowsInSection:(NSInteger)section;
- (UITableViewCell *)tableView:(PTEHorizontalTableView *)horizontalTableView
cellForRowAtIndexPath:(NSIndexPath *)indexPath;
@optional
- (NSUInteger)numberOfSectionsInTableView:(PTEHorizontalTableView*)horizontalTableView;
- (void)tableView:(PTEHorizontalTableView *)horizontalTableView
didSelectRowAtIndexPath:(NSIndexPath *)indexPath;
- (UIView*)tableView:(PTEHorizontalTableView*)horizontalTableView
viewForHeaderInSection:(NSInteger)section;
- (UIView*)tableView:(PTEHorizontalTableView*)horizontalTableView
viewForFooterInSection:(NSInteger)section;
- (CGFloat)tableView:(PTEHorizontalTableView *)horizontalTableView
widthForCellAtIndexPath:(NSIndexPath *)indexPath;
@end
License - 版权
Copyright 2014 Ernesto Rivera
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.