一個iOS彈性側滑菜單:LLSlideMenu

jopen 8年前發布 | 18K 次閱讀 iOS開發 移動開發 LLSlideMenu

LLSlideMenu

This is a spring slide menu for iOS apps
一個彈性側滑菜單

彈性動畫原理借鑒該項目中阻尼函數實現

Preview  預覽

image

Installation  安裝

  • pod
    1.pod "LLSlideMenu"
    2.pod install       // 若獲取失敗請重新 pod setup
    3.#import "LLSlideMenu.h"
  • Common
    1.Add "LLSlideMenu" files to your Project   // 直接導入“LLSlideMenu”文件夾到項目中
    2.#import "LLSlideMenu.h"

Usage  用法

  • Init  初始化
LLSlideMune *slideMenu = [[LLSlideMune alloc] init];
[self.view addSubview:slideMenu];
  • Base Property  基本屬性
// 設置菜單寬度  menu width
_slideMenu.ll_menuWidth = 200.f;

// 設置菜單背景色  background color
_slideMenu.ll_menuBackgroundColor = [UIColor redColor];

// 設置菜單背景圖片  background image
_slideMenu.ll_menuBackgroundImage = [UIImage imageNamed:@"image"];

// 背景色或背景圖片設置一個即可  background image and color select one
  • Open or Close  打開或關閉
[_slideMenu ll_openSlideMenu];      // 打開  open
[_slideMenu ll_closeSlideMenu];     // 關閉  close
  • GestureRecognizer  手勢監聽
_slideMenu.ll_distance = 100.f;     // 拉伸距離  pulling distance
  • Spring and Frames  彈力和關鍵幀設置(可控制彈性效果和時間)
_slideMenu.ll_springDamping = 20;       // 阻力
_slideMenu.ll_springVelocity = 15;      // 速度
_slideMenu.ll_springFramesNum = 60;     // 關鍵幀數量

Requirements  版本要求

IOS 6.0 Above

License

LLSlideMenu is provided under the MIT license. See LICENSE file for details.

項目地址: https://github.com/lilei644/LLSlideMenu

 本文由用戶 jopen 自行上傳分享,僅供網友學習交流。所有權歸原作者,若您的權利被侵害,請聯系管理員。
 轉載本站原創文章,請注明出處,并保留原始鏈接、圖片水印。
 本站是一個以用戶分享為主的開源技術平臺,歡迎各類分享!