Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

dby/TabSwipable

Folders and files

NameName
Last commit message
Last commit date

Latest commit

History

11 Commits

Repository files navigation

##Swipable

video
video


###Swipable是什么
Swipable实现了类似于网易新闻的标签选择页,只需要几行代码便可以集成,具体的使用方法参考Demo。


###Swipable的实现的方法
Swipable是利用TableView来实现的,每个cell对应着一个ViewController的view(如以下代码所示);然后利用旋转实现。

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
 UITableViewCell *cell = [self.tableView dequeueReusableCellWithIdentifier:kHorizonalCellID forIndexPath:indexPath];
 cell.contentView.transform = CGAffineTransformMakeRotation(M_PI_2);
 cell.contentView.backgroundColor = [UIColor colorWithRed:235.0/255 green:235.0/255 blue:243.0/255 alpha:1.0];
 cell.selectionStyle = UITableViewCellSeparatorStyleNone;
 
 UIViewController *controller = _controllers[indexPath.row];
 controller.view.frame = cell.contentView.bounds;
 [cell.contentView addSubview:controller.view];
 
 return cell;
}

当没有旋转时:
video
TableView进行旋转90度:
video
TableView中的每个cell旋转90度:
video

到此,Swipable便实现了。


###CocoaPods
你可以在 Podfile 中加入下面一行代码来使用Swipable框架。

pod 'TabSwipable', '0.0.3' 

欢迎大家提高pull request,希望大家star;

###Thanks
@开源中国:这个框架是在开源中国ios客户端总结出来的,并在此基础上进行了完善,欢迎大家再次进行完善。开源中国ios客户端源码地址:http://git.oschina.net/oschina/iphone-app

About

类似于ViewPager的一个iOS框架

Resources

License

Stars

Watchers

Forks

Packages

Contributors

AltStyle によって変換されたページ (->オリジナル) /