iPad的UI解决一种方案-使用栈管理viewControllers PSStackedView

代码地址:https://github.com/steipete/PSStackedView

PSStackedView - put your UIViewControllers in a stack, inspired by Twitter's iPAD UI.

After reviewing other stacked implementations, i wrote my own solutions from scratch. This one lets you add plain UIViewControllers to a PSStackedViewRootViewController, working much like a UINavigationController.

All the hard parts, moving, shadows, rounded borders is taken care of.

I made it for the iPad-Version of the popular austrian TV app "3MobileTV". (You need an austrian 3-SIM to test it, but you can check out the screenshots to get the idea what's possible with it).

Currently there is a positioning bug with small view controllers, I'll fix that in the foreseeable future. Otherwise, it's pretty much a drop-in-replacement for UINavigationController, using regular UIViewControllers. It supports iOS4 upwards, with some special support for iOS5's new view controller containment coming.

It works on the iPad and the iPhone, but the concept is better suited for the iPad.

PSStackedView

... and custom-skinned, you can build pretty hot interfaces:

PSStackedView

Getting Started

Much like UINavigationController, it's a good idea to put your PSStackedViewRootController in the AppDelegate:

@property (nonatomic, retain) PSStackedViewRootController *stackController;

Create the stack in application:didFinishLaunchingWithOptions:

ExampleMenuRootController *menuController = [[[ExampleMenuRootController alloc] init] autorelease];
self.stackController = [[[PSStackedViewRootController alloc] initWithRootViewController:menuController] autorelease];
[self.stackController pushViewController:demoViewController fromViewController:nil animated:NO];
window.rootViewController = self.stackController;

PSStackedViewRootController's rootViewController is in the background and its left part is always visible. Adjust the size with leftInset and largeLeftInset.

Roadmap

  • Add (conditional) support for the new child view controller system in iOS5
  • Appledoc
  • lots more

License

Licensed under MIT. Use it for whatever you want, in commercial apps or open source. I just wand a little contribution somewhere in your about box.

Alternatives

There are some open source and commerical stacked implementations out there, yet none of them were flexible enough to fit my needs. Special thanks to Cocoacontrols for this article.

转载于:https://www.cnblogs.com/fengnianji/archive/2012/12/20/PSStackedView.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值