react-native-gizwits-scroll-ruler 1.0.0 → 1.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/index.ios.js
CHANGED
|
@@ -7,6 +7,7 @@ type PropsType = {
|
|
|
7
7
|
maxValue?: number;
|
|
8
8
|
step?: number;
|
|
9
9
|
defaultValue?: number;
|
|
10
|
+
disabled?: bool;
|
|
10
11
|
num?: number;
|
|
11
12
|
unit?: string;
|
|
12
13
|
} & typeof
|
|
@@ -18,6 +19,7 @@ export default class RNScrollRuler extends Component {
|
|
|
18
19
|
maxValue: PropTypes.number.isRequired,
|
|
19
20
|
step: PropTypes.number.isRequired,
|
|
20
21
|
defaultValue: PropTypes.number.isRequired,
|
|
22
|
+
disabled: PropTypes.bool.isRequired,
|
|
21
23
|
num: PropTypes.number.isRequired,
|
|
22
24
|
unit: PropTypes.string,
|
|
23
25
|
onSelect: PropTypes.func,
|
|
@@ -15,11 +15,11 @@
|
|
|
15
15
|
#define RulerLineColor [UIColor grayColor]
|
|
16
16
|
#define LineWidth 2.0
|
|
17
17
|
|
|
18
|
-
#define RulerGap
|
|
19
|
-
#define RulerLong
|
|
18
|
+
#define RulerGap 8 //单位距离
|
|
19
|
+
#define RulerLong 40
|
|
20
20
|
#define RulerShort 30
|
|
21
21
|
#define TrangleWidth 16
|
|
22
|
-
#define CollectionHeight
|
|
22
|
+
#define CollectionHeight 50
|
|
23
23
|
|
|
24
24
|
#define TriangleColor [UIColor colorWithRed:255/255.0 green:121/255.0 blue:30/255.0 alpha:1]
|
|
25
25
|
|
|
@@ -344,9 +344,10 @@
|
|
|
344
344
|
|
|
345
345
|
-(DYTriangleView *)triangle{
|
|
346
346
|
if (!_triangle) {
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
347
|
+
CGFloat height =RulerLong-10;
|
|
348
|
+
NSArray* arr = @[@(height-18),@(height-13),@(height-8),@(height-3),@(height-8),@(height-13),@(height-18)];
|
|
349
|
+
CGFloat width = (arr.count-1)*RulerGap+4;
|
|
350
|
+
_triangle = [[DYTriangleView alloc]initWithFrame:CGRectMake(self.bounds.size.width/2-width/2+2, self.collectionView.frame.origin.y+(self.collectionView.frame.size.height-height), width, height)];
|
|
350
351
|
_triangle.lineHeightArray = arr;
|
|
351
352
|
_triangle.backgroundColor = _bgColor;
|
|
352
353
|
_triangle.bgColor = _bgColor;
|
|
@@ -422,7 +423,7 @@
|
|
|
422
423
|
}
|
|
423
424
|
|
|
424
425
|
+(CGFloat)rulerViewHeight{
|
|
425
|
-
return
|
|
426
|
+
return 30+20+CollectionHeight;
|
|
426
427
|
}
|
|
427
428
|
|
|
428
429
|
#pragma mark UICollectionViewDataSource & Delegate
|
package/package.json
CHANGED
|
@@ -3,7 +3,7 @@ require 'json'
|
|
|
3
3
|
package = JSON.parse(File.read(File.join(__dir__, 'package.json')))
|
|
4
4
|
|
|
5
5
|
Pod::Spec.new do |s|
|
|
6
|
-
s.name = "react-native-scroll-ruler"
|
|
6
|
+
s.name = "react-native-gizwits-scroll-ruler"
|
|
7
7
|
s.version = package['version']
|
|
8
8
|
s.summary = package['description']
|
|
9
9
|
s.license = package['license']
|