All Projects → cba023 → CoolSlidingMenu

cba023 / CoolSlidingMenu

Licence: other
A powerful menu that you can customize it。

Programming Languages

swift
15916 projects

Projects that are alternatives of or similar to CoolSlidingMenu

Omfm
Another floating action button menu with expand/collapse behavior, in kotlin
Stars: ✭ 86 (+244%)
Mutual labels:  custom, menu
Wmzdialog
功能最多样式最多的弹窗,支持普通/微信底部/日期/地区/日历/选择/编辑/分享/菜单/自定义弹窗等,支持多种动画,链式编程调用(Pop-up windows with the most functions and styles, support normal/WeChat bottom/date/region/calendar/select/edit/share/menu/custom pop-up windows, etc., support multiple animations, chain programming calls)
Stars: ✭ 673 (+2592%)
Mutual labels:  custom, menu
Persei
Animated top menu for UITableView / UICollectionView / UIScrollView written in Swift
Stars: ✭ 3,395 (+13480%)
Mutual labels:  custom, menu
react-native-panel
A Customizable React Native Panel for Android and iOS
Stars: ✭ 35 (+40%)
Mutual labels:  slide, menu
Drawer Behavior Flutter
Drawer behavior is a library that provide an extra behavior on drawer, such as, move view or scaling view's height while drawer on slide.
Stars: ✭ 110 (+340%)
Mutual labels:  slide, menu
Figlet Fonts
my collection of figlet / toilet ascii art fonts
Stars: ✭ 393 (+1472%)
Mutual labels:  collection, custom
Wmzdropdownmenu
🌹一个能几乎实现所有App各种类型筛选菜单的控件,可悬浮,目前已实现闲鱼/美团/Boss直聘/京东/饿了么/淘宝/拼多多/赶集网/美图外卖等等的筛选菜单,可以自由调用代理实现自己想组装的筛选功能和UI,且控件的生命周期自动管理,悬浮自动管理🌹(A control that can implement almost all types of filtering menus of all apps)
Stars: ✭ 503 (+1912%)
Mutual labels:  custom, menu
Duo Navigation Drawer
A flexible, easy to use, unique drawer library for your Android project.
Stars: ✭ 986 (+3844%)
Mutual labels:  slide, menu
Xlslidemenu
iOS 仿QQ的左右抽屉效果
Stars: ✭ 122 (+388%)
Mutual labels:  slide, menu
WBChainMenu
This will show horizontal menu to a UITableViewCell with chain animation
Stars: ✭ 28 (+12%)
Mutual labels:  custom, menu
Compact-Unity-Events
UnityEvents drawer with collapsing, reordering and compact UX
Stars: ✭ 41 (+64%)
Mutual labels:  custom
MBVideoPlayer
A video player on top of AVQueuePlayer with custom header, playlist items, play, pause, seek to slider, time, resize to fullscreen, forward, backward horizontal, vertical capabilities.
Stars: ✭ 103 (+312%)
Mutual labels:  custom
postel
tiny react library for building tooltips, flyovers, menus and more
Stars: ✭ 70 (+180%)
Mutual labels:  menu
WaveSideBar
Animated side bar view
Stars: ✭ 38 (+52%)
Mutual labels:  menu
ShapeCrawler
A .NET library for manipulating PowerPoint presentations.
Stars: ✭ 88 (+252%)
Mutual labels:  slide
react-native-animated-menu
Top-down animated menu transition concept
Stars: ✭ 56 (+124%)
Mutual labels:  menu
angular-projects
A collection of projects built on the Angular framework
Stars: ✭ 17 (-32%)
Mutual labels:  collection
slides
No description or website provided.
Stars: ✭ 27 (+8%)
Mutual labels:  slide
ml-stack-nav
Customizable, responsive, accessible, easy-to-use multi-level stack navigation menu with slide effect.
Stars: ✭ 20 (-20%)
Mutual labels:  menu
SlideTable
可以滑动 以表格形式展示数据
Stars: ✭ 14 (-44%)
Mutual labels:  slide

CoolSlidingMenu

#CoolSlidingMenu

开发环境(Development environment)

Mac OS / Swift5.1

支持环境(Support environment)

iOS, iPhone & iPad

项目获取(Project acquisition)

此处代码由Swift展示,推荐使用Swift项目已经上传至github中(The code here is shown by Swift, and the Swift project is recommended for uploading to GitHub)CoolSlidingMenu(https://github.com/cba023/CoolSlidingMenu) 若要使用,请导入文件到您的项目。(To use, import the file into your project) 简书地址(Address of JianShu):http://www.jianshu.com/p/375fe7984571

功能展示(Demonstrate)

User guide

使用说明(Guides)

导入项目(Import Means)

1. 手动导入(Manual import)

手动导入项目需要将该文件夹的所有内容引入项目中(Manual import projects need to bring all of the contents of the folder into the project)

如图所示,将“CoolSlingMenu”文件夹拖入要用到该框架的工程中,在Swift项目中,可直接对其进行使用,ObjC项目中需要用到桥接。(As shown, drag the "CoolSlingMenu" folder into the project that you want to use in the framework. You can use it directly in the Swift project, and bridging is required in the ObjC project)

对项目菜单进行定制(Customizing the Project menu)

创建滚动菜单视图(Creating a slidingMenuView)

var slidingMenuView = CoolSlidingMenuView()

定制我们要使用的CoolSlidingMenu (Customize the CoolSlidingMenu we want to use)

// 显示滑动菜单pageControl (Display slider menu)
slidingMenuView.pgCtrl.isHidden = false  
// 未选中页pageControl颜色 (UnSelectedColor of pageControl)
slidingMenuView.pgCtrlNormalColor = .lightGray
// 选中页pageControl颜色 (SelectedColor of pageControl)
slidingMenuView.pgCtrlSelectedColor = .red
// 设置滑动菜单的行数 (Sets the number of rows in the sliding menu)
slidingMenuView.countRow = 2
// 设置滑动菜单的列数 (Sets the number of columns in the sliding menu)
slidingMenuView.countCol = 5

CoolSlidingMenu数据源 (date source)

数组格式如下所示: 屏幕快照 2017-08-20 16.14.21.png (screen shot)

滑动菜单数据源是带title 和image 两个key的字典型数组:(The sliding menu data source is the two key dictionary array with title and image)

let arrMenu = [
  ["title":"0美食","image":"img1.png"],(Food)
  ["title":"2电影","image":"img2.png"], (Movie)
  ["title":"3健身","image":"img3.png"]   (Fitness)
]
slidingMenuView.arrMenu = arrMenu

添加CoolSlidingMenu到视图中 (Add CoolSlidingMenu to view)

let width = UIScreen.main.bounds.size.width
slidingMenuView.contentMode = .scaleAspectFit
// 行数2, 列数5,pageControl预留高度8 (Number of rows 2, number of columns 5, pagecontrol reserved height 8)
slidingMenuView.frame = CGRect(x: 0, y: 0, width: width, height: width / 5.0 * 2.0 + 8.0)
self.view.addSubview(slidingMenuView)

实现原理 (Impelmentation principle)

CoolSlidingMenu主要通过UICollectionView实现,在滑动菜单中,是从左至右排列的,所以我们想要的布局如下:(CoolSlidingMenu is implemented primarily through UICollectionView,in the slide menu, it is arranged from left to right, so the layout we want is as follows ) 1.我们想要的效果 然而,UICollectionView的实际排列确实纵向排列。如下图:(However, the actual arrangement of the UICollectionView is indeed aligned vertically) 2.UICollectionView默认的排列方式

所以我们要将纵向排列转换成横向排列,CoolSlidingMenu中用到转换函数如下:(So we want to convert the vertical array into horizontal arrays, and the conversion function used in CoolSlidingMenu is as follows)

/// Converting the ordering of Numbers Author: ChenBo
    ///
    /// - Parameters:
    ///   - number: input number  输入的数字
    ///   - rowCount: rows count   行数
    ///   - colCount: cols count   列数
    /// - Returns: output number  输出的数字
func convertDirectionCount(Number number:Int, RowCount rowCount: Int, ColCount colCount: Int) -> Int {
        // 十位
        let tempH = number / (colCount * rowCount)
        // 个位
        let tempL = number % (colCount * rowCount)
        let result:Int = tempL - (tempL / rowCount) * (rowCount - 1) + tempL % rowCount * (colCount - 1) + tempH * (colCount * rowCount)
//        print("排序前:",number,"行数:",rowCount, "列数:" ,"tempH:",tempH,"tempL:",tempL, colCount,"----->",result)
        return result
    }

经过转换,滑动菜单就从纵向排列转化为横向排列了。 亲,懂了吗?赶快去嗨皮吧!(After transformation, the slide menu changes from a vertical arrangement to a horizontal arrangement。Do you understand? Hurry up, go happy!)

致读者(To reader)

该项目已经上传至github中CoolSlidingMenu(https://github.com/cba023/CoolSlidingMenu) (The project has been uploaded to GitHub) 可以在那里直接star 或者fork 该项目,它可能会长期的帮助您高效地进行程序开发,当然也欢迎留言,有不足或者错误的地方可以随时指正,您的指导和建议是我前行路上新的动力!(Where can star or fork of the project, it may help you efficiently develop the program, Welcome to leave a message and make comments. Your guidance and advice is a new impetus for me on the road!)

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].