|
12 | 12 |  |
13 | 13 | [](https://twitter.com/LiuChuan_) |
14 | 14 |
|
| 15 | +--- |
15 | 16 |
|
16 | 17 | ## What is LCSlideMenu? |
17 | 18 |
|
|
22 | 23 |
|
23 | 24 | |  |  |  |  | |
24 | 25 | | :------------: | :------------: | :------------: | :------------: | |
25 | | -| `indicatorType = .stretch` `titleStyle = .gradient` | `indicatorType = .normal` `titleStyle = .cover` | `indicatorType = .stretch` `titleStyle = .transfrom` | `indicatorType = .normal` `titleStyle = .transfrom` | |
| 26 | +| `indicatorType = .stretch` `titleStyle = .gradient` | `indicatorType = .cover` `titleStyle = .gradient` | `indicatorType = .stretch` `titleStyle = .transfrom` | `indicatorType = .normal` `titleStyle = .transfrom` | |
| 27 | + |
| 28 | +|  |  |  |  | |
| 29 | +| :------------: | :------------: | :------------: | :------------: | |
| 30 | +| `indicatorType = .cover` `titleStyle = .gradient` | `isShowIndicatorView = false` `titleStyle = .transfrom` | `indicatorType = .cover` `titleStyle = .transfrom` | `isShowIndicatorView = false` `titleStyle = .gradient` | |
| 31 | + |
| 32 | +--- |
| 33 | + |
| 34 | + |
| 35 | +## Attribute |
| 36 | + |
| 37 | +| Attribute name | Specific introduction of attributes | |
| 38 | +| :------------: | :------------: | |
| 39 | +| `coverView` | Mask the view | |
| 40 | +| `indicatorType ` | LCSlideMenu of indicator type | |
| 41 | +| `titleStyle` | Heading styles | |
| 42 | +| `itemFont` | The font size of the heading | |
| 43 | +| `isShowIndicatorView` | Whether to display the indicator view | |
| 44 | +| `isNeedMask` | Do you need a mask? | |
| 45 | +| `coverHeight` | The height of the mask view | |
| 46 | +| `coverColor` | The background color of the mask view | |
| 47 | +| `selectedColor` | The color in the currently selected state | |
| 48 | +| `unSelectedColor` | The color of the unchecked state | |
| 49 | +| `bottomPadding` | The indicator is at the bottom | |
| 50 | +| `indicatorHeight` | Height of indicator | |
| 51 | + |
| 52 | + |
| 53 | +--- |
26 | 54 |
|
27 | 55 | ## Requirements |
28 | 56 |
|
@@ -80,23 +108,23 @@ class ViewController: UIViewController { |
80 | 108 | fileprivate func example() { |
81 | 109 |
|
82 | 110 | let titles = ["Apple", "Banana", "Watermelon", "Orange", "Lemon", "Pear","Strawberry", "Sapodilla", "Haw", "Grape","Mango", "Plum", "Persimmon", "Fig", "Betelnut"] |
83 | | - |
84 | 111 | var controllers: [UIViewController] = [] |
85 | 112 |
|
86 | 113 | for _ in 0 ..< titles.count { |
87 | 114 | let vc = UIViewController() |
88 | 115 | vc.view.backgroundColor = UIColor(red: CGFloat(arc4random() % 256) / 255, green: CGFloat(arc4random() % 256) / 255, blue: CGFloat(arc4random() % 256) / 255, alpha: 1) |
89 | | - |
90 | 116 | addChildViewController(vc) |
91 | 117 | controllers.append(vc) |
92 | 118 | } |
93 | 119 | /* -- LCSlideMenu -- */ |
94 | 120 | let slideMenu = LCSlideMenu(frame: CGRect(x: 0, y: 64, width: view.frame.width, height: 40), titles: titles, childControllers: controllers) |
95 | | - slideMenu.indicatorType = .stretch |
| 121 | + slideMenu.indicatorType = .cover |
96 | 122 | slideMenu.titleStyle = .gradient |
97 | | - slideMenu.isShowIndicatorView = true |
98 | | - slideMenu.isNeedMask = false |
99 | | - slideMenu.selectedColor = .red |
| 123 | + slideMenu.isShowIndicatorView = false |
| 124 | + slideMenu.isNeedMask = true |
| 125 | + slideMenu.coverView.layer.cornerRadius = slideMenu.coverHeight * 0.2 |
| 126 | + slideMenu.coverColor = .black |
| 127 | + slideMenu.selectedColor = .white |
100 | 128 | slideMenu.unSelectedColor = .black |
101 | 129 | slideMenu.indicatorView.backgroundColor = .red |
102 | 130 | view.addSubview(slideMenu) |
|
0 commit comments