All Projects → agdsdl → Dlslideview

agdsdl / Dlslideview

Licence: mit
Tabed slide view based on container of ViewController(not UIScrollView). Support infinite pages.

Projects that are alternatives of or similar to Dlslideview

Ly Tab
A better mobile touch-swappable reusable component for Vue 2.0
Stars: ✭ 281 (-56.77%)
Mutual labels:  tab
Hyawesometransition
Custom transition between viewcontrollers
Stars: ✭ 368 (-43.38%)
Mutual labels:  viewcontroller
Presenterkit
Custom presenters and better view controller presentation for iOS
Stars: ✭ 520 (-20%)
Mutual labels:  viewcontroller
Xamarin Forms Tab Badge
Xamarin Forms bindable Tab badges for iOS, Android, UWP, MacOS and WPF
Stars: ✭ 304 (-53.23%)
Mutual labels:  tab
React Tabtab
💃 Make your react tab dance🕺
Stars: ✭ 347 (-46.62%)
Mutual labels:  tab
Medusa
Android fragment stack controller
Stars: ✭ 395 (-39.23%)
Mutual labels:  tab
SBCardPopup
Card Popup UI for iOS
Stars: ✭ 66 (-89.85%)
Mutual labels:  viewcontroller
Nighttab
A neutral new tab page accented with a chosen colour. Customise the layout, style, background and bookmarks in nightTab.
Stars: ✭ 598 (-8%)
Mutual labels:  tab
Electron Tabs
Simple tabs for Electron applications
Stars: ✭ 350 (-46.15%)
Mutual labels:  tab
Messagekit
A community-driven replacement for JSQMessagesViewController
Stars: ✭ 5,036 (+674.77%)
Mutual labels:  viewcontroller
Jsqwebviewcontroller
[Deprecated] A lightweight Swift WebKit view controller for iOS
Stars: ✭ 307 (-52.77%)
Mutual labels:  viewcontroller
Bento
🍱 Minimalist, elegant and simple startpage inspired by the Bento box!
Stars: ✭ 325 (-50%)
Mutual labels:  tab
Tocropviewcontroller
A view controller for iOS that allows users to crop portions of UIImage objects
Stars: ✭ 4,210 (+547.69%)
Mutual labels:  viewcontroller
Flowhelper
帮助您迅速构建顶部Tab,比如今日头条效果,热搜、搜索记录、与ViewPager/ViewPager2搭配的工具类;
Stars: ✭ 295 (-54.62%)
Mutual labels:  tab
Navigationtabbar
Navigation tab bar with colorful interactions.
Stars: ✭ 4,907 (+654.92%)
Mutual labels:  tab
Snackview
Customizable bottom-half alerts.
Stars: ✭ 280 (-56.92%)
Mutual labels:  viewcontroller
Locationpicker
A ready for use and fully customizable location picker for your app
Stars: ✭ 384 (-40.92%)
Mutual labels:  viewcontroller
Wxp Ui
小程序插件合集(下拉刷新, 拖拽排序, 索引列表, 日期选择, 侧滑删除...)
Stars: ✭ 636 (-2.15%)
Mutual labels:  tab
Datasources
💾 🔜📱 Type-safe data-driven CollectionView, TableView Framework. (We can also use ASCollectionNode)
Stars: ✭ 553 (-14.92%)
Mutual labels:  viewcontroller
Router
🛣 Simple Navigation for iOS
Stars: ✭ 438 (-32.62%)
Mutual labels:  viewcontroller

DLSlideView

DLSlideView对常见的顶部Tab页点击、滑动分页做了封装。 它使用基于ViewController的container特性(而不是scrollview)来管理各个子页面,保留原始的系统消息,没有隐患。 同时内存模型更优于使用scrollview的方式,理论上可以支持无限分页。

可自定义标签栏:

demo-1

使用方法:

1.初始化DLTabedSlideView

self.tabedSlideView.baseViewController = self;
self.tabedSlideView.tabItemNormalColor = [UIColor blackColor];
self.tabedSlideView.tabItemSelectedColor = [UIColor colorWithRed:0.833 green:0.052 blue:0.130 alpha:1.000];
self.tabedSlideView.tabbarTrackColor = [UIColor colorWithRed:0.833 green:0.052 blue:0.130 alpha:1.000];
self.tabedSlideView.tabbarBackgroundImage = [UIImage imageNamed:@"tabbarBk"];
self.tabedSlideView.tabbarBottomSpacing = 3.0;
DLTabedbarItem *item1 = [DLTabedbarItem itemWithTitle:@"最新" image:[UIImage imageNamed:@"goodsNew"] selectedImage:[UIImage imageNamed:@"goodsNew_d"]];
DLTabedbarItem *item2 = [DLTabedbarItem itemWithTitle:@"最热" image:[UIImage imageNamed:@"goodsHot"] selectedImage:[UIImage imageNamed:@"goodsHot_d"]];
DLTabedbarItem *item3 = [DLTabedbarItem itemWithTitle:@"价格" image:[UIImage imageNamed:@"goodsPrice"] selectedImage:[UIImage imageNamed:@"goodsPrice_d"]];
self.tabedSlideView.tabbarItems = @[item1, item2, item3];
[self.tabedSlideView buildTabbar];
self.tabedSlideView.selectedIndex = 0;

2.实现delegate

- (NSInteger)numberOfTabsInDLTabedSlideView:(DLTabedSlideView *)sender{
    return 3;
}
- (UIViewController *)DLTabedSlideView:(DLTabedSlideView *)sender controllerAt:(NSInteger)index{
    switch (index) {
        case 0:
        {
            OneViewController *ctrl = [[OneViewController alloc] init];
            return ctrl;
        }
        case 1:
        {
            TwoViewController *ctrl = [[TwoViewController alloc] init];
            return ctrl;
        }
        case 2:
        {
            ThreeViewController *ctrl = [[ThreeViewController alloc] init];
            return ctrl;
        }

        default:
            return nil;
    }
}

类似网易新闻,支持无限页面:

demo-2

使用方法:

1.初始化DLCustomSlideView

DLLRUCache *cache = [[DLLRUCache alloc] initWithCount:6];
DLScrollTabbarView *tabbar = [[DLScrollTabbarView alloc] initWithFrame:CGRectMake(0, 0, self.view.frame.size.width, 34)];
tabbar.tabItemNormalColor = [UIColor blackColor];
tabbar.tabItemSelectedColor = [UIColor redColor];
tabbar.tabItemNormalFontSize = 14.0f;
tabbar.trackColor = [UIColor redColor];
itemArray_ = [NSMutableArray array];
DLScrollTabbarItem *item = [DLScrollTabbarItem itemWithTitle:@"推荐" width:80];
[itemArray_ addObject:item];
for (int i=0; i<10; i++) {
    item = [DLScrollTabbarItem itemWithTitle:[NSString stringWithFormat:@"页面%d", i+1] width:50];
    [itemArray_ addObject:item];
}
tabbar.tabbarItems = itemArray_;
self.slideView.tabbar = tabbar;
self.slideView.cache = cache;
self.slideView.tabbarBottomSpacing = 5;
self.slideView.baseViewController = self;
[self.slideView setup];
self.slideView.selectedIndex = 0;

2.实现delegate

- (NSInteger)numberOfTabsInDLCustomSlideView:(DLCustomSlideView *)sender{
    return itemArray_.count;
}

- (UIViewController *)DLCustomSlideView:(DLCustomSlideView *)sender controllerAt:(NSInteger)index{
    PageNViewController *ctrl = [[PageNViewController alloc] init];
    int32_t rgbValue = rand();
    ctrl.view.backgroundColor = [UIColor colorWithRed:((rgbValue & 0xFF0000) >> 16)/255.0 green:((rgbValue & 0xFF00) >> 8)/255.0 blue:(rgbValue & 0xFF)/255.0 alpha:1.0];
    ctrl.pageLabel.text = [NSString stringWithFormat:@"%ld", (long)index];
    return ctrl;
}
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].