DKTabPageViewController

来源:互联网 发布:房源中介系统源码 编辑:程序博客网 时间:2024/04/28 17:57

DKTabPageViewController是一个UIViewController的子类,其基于Child ViewController管理多个页面,支持手动滚动,以及是否显示顶部的Tab等。每一个Tab对应一个UIViewController实例,与其他的Tab相互独立,View支持懒加载及viewWillAppear、viewWillDisappear等方法。



简单的接口:

@property (nonatomic, assign) NSInteger selectedIndex;

@property (nonatomic, readonly) UIViewController *selectedViewController;


/**

 *  Whether show the Tab Bar. Defaults to YES.

 */

@property (nonatomic, assign) BOOL showTabPageBar;


/**

 *  Whether allow scroll gestures. Defaults to YES.

 */

@property (nonatomic, assign) BOOL gestureScrollEnabled;


/**

 *  The block to be executed on the page changed.

 */

@property (nonatomic, copy) void (^pageChangedBlock)(NSInteger selectedIndex); 

可定制的DKTabPageBar: 

@interface DKTabPageBar : UIView


/**

 *  Height of the tab bar. Defautls to 40.

 */

@property (nonatomic, assign) CGFloat tabBarHeight UI_APPEARANCE_SELECTOR;


/**

 *  Font of the tab bar. Defautls to [UIFont systemFontOfSize:14].

 */

@property (nonatomic, strong) UIFont *titleFont UI_APPEARANCE_SELECTOR;


/**

 *  The selection indicator is draw on bottom of the tab bar.

 */

@property (nonatomic, strong) UIView *selectionIndicatorView;


@property(nonatomic, copy) UIColor *backgroundColor UI_APPEARANCE_SELECTOR;


@end

GitHub地址

0 0
原创粉丝点击