1
- [ ![ nStudio Plugin] ( https://img.shields.io/badge/nStudio-Plugin-blue.svg )] ( http://nstudio.io )
1
+ <p align =" center " >
2
+ <p align =" center " >
3
+
2
4
[ ![ npm] ( https://img.shields.io/npm/v/nativescript-cardview.svg )] ( https://www.npmjs.com/package/nativescript-cardview )
3
5
[ ![ npm] ( https://img.shields.io/npm/dt/nativescript-cardview.svg?label=npm%20downloads )] ( https://www.npmjs.com/package/nativescript-cardview )
6
+ [ ![ nStudio Plugin] ( https://img.shields.io/badge/nStudio-Plugin-blue.svg )] ( http://nstudio.io )
4
7
5
8
# NativeScript CardView :diamonds : :clubs :
6
9
7
10
A NativeScript plugin to provide an XML widget to implement the Material Design CardView component.
8
11
12
+ </p >
13
+
9
14
##### [ Material Design Card Spec] ( https://www.google.com/design/spec/components/cards.html )
10
- ##### [ CardView Android Documentation] ( http://developer.android.com/intl/zh-tw/reference/android/support/v7/widget/CardView.html )
11
15
16
+ ##### [ CardView Android Documentation] ( http://developer.android.com/intl/zh-tw/reference/android/support/v7/widget/CardView.html )
12
17
13
18
## Installation
14
19
20
+ ##### NativeScript 4x
21
+
22
+ * ` tns plugin add nativescript-cardview `
23
+
24
+ ##### NativeScript 3x
25
+
26
+ * ` tns plugin add [email protected] `
27
+
15
28
##### NativeScript 2.x
16
- - ` tns plugin add nativescript-cardview@^1.3.2 `
17
29
18
- ##### NativeScript 3+
19
- - ` tns plugin add nativescript-cardview `
30
+ * ` tns plugin add [email protected] `
31
+
32
+ Be sure to run a new build after adding plugins to avoid any issues. Here is a post with some details: [ Plugin Not Working after adding to project.] ( https://bradmartin.net/2016/07/20/ahhh-this-nativescript-plugin-doesnt-work/_ )
20
33
21
- * Be sure to run a new build after adding plugins to avoid any issues. Here is a post with some details: https://bradmartin.net/2016/07/20/ahhh-this-nativescript-plugin-doesnt-work/ *
22
-
23
34
## Vanilla NativeScript
24
35
25
- <span style =" color :red " >IMPORTANT: </span >* Make sure you include ` xmlns:Card="nativescript-cardview" ` on the Page element *
36
+ <span style =" color :red " >IMPORTANT: </span >_ Make sure you include ` xmlns:Card="nativescript-cardview" ` on the Page element _
26
37
27
38
### XML
39
+
28
40
``` XML
29
41
<Page xmlns : Card =" nativescript-cardview" >
30
- <StackLayout >
42
+ <StackLayout >
31
43
<Card : CardView class =" cardStyle" margin =" 10" elevation =" 40" radius =" 5" >
32
44
<grid-layout rows =" 200, auto, auto" columns =" auto, auto, *" >
33
45
<image src =" ~/images/batman.jpg" stretch =" aspectFill" colSpan =" 3" row =" 0" />
34
- <label text =" Batman wants to be friends?" class =" info" textWrap =" true" row =" 1" colSpan =" 3" />
46
+ <label text =" Batman wants to be friends?" class =" info" textWrap =" true" row =" 1" colSpan =" 3" />
35
47
<button text =" DECLINE" tap =" goAway" row =" 2" col =" 0" />
36
48
<button text =" ACCEPT" row =" 2" col =" 1" />
37
49
</grid-layout >
@@ -41,14 +53,14 @@ A NativeScript plugin to provide an XML widget to implement the Material Design
41
53
```
42
54
43
55
### CSS
56
+
44
57
``` CSS
45
58
.cardStyle {
46
59
background-color : #3489db ;
47
60
color : #fff ;
48
61
}
49
62
```
50
63
51
-
52
64
## Angular NativeScript
53
65
54
66
``` TS
@@ -71,43 +83,44 @@ elementRegistryModule.registerElement("CardView", () => require("nativescript-ca
71
83
72
84
## Attributes
73
85
74
- * ** radius** * optional *
86
+ * ** radius** _ optional _
75
87
76
88
An attribute to control the 'border-radius' of the card.
77
89
78
90
### Platform specific options
79
91
80
92
#### Android
81
93
82
- * ** elevation** * optional *
94
+ * ** elevation** _ optional _
83
95
84
- An attribute to set the elevation of the card. This will increase the 'drop-shadow' of the card.
96
+ An attribute to set the elevation of the card. This will increase the 'drop-shadow' of the card.
85
97
There can be some performance impact when using a very high elevation value.
86
98
87
99
#### iOS
88
100
89
- * ** shadowOffsetWidth** * optional *
101
+ * ** shadowOffsetWidth** _ optional _
90
102
91
103
An attribute to offset the x position of the shadow behind the card.
92
-
93
- * ** shadowOffsetHeight** * optional *
104
+
105
+ * ** shadowOffsetHeight** _ optional _
94
106
95
107
An attribute to offset the y position of the shadow behind the card.
96
108
97
- * ** shadowColor** * optional *
109
+ * ** shadowColor** _ optional _
98
110
99
111
An attribute to set the color of the shadow behind the card.
100
112
101
- * ** shadowOpacity** * optional *
113
+ * ** shadowOpacity** _ optional _
102
114
103
115
An attribute to set the opacity of the shadow behind the card.
104
116
105
- * ** shadowRadius** * optional *
117
+ * ** shadowRadius** _ optional _
106
118
107
119
An attribute to set the radius of the shadow (shadow spread) behind the card.
108
120
109
121
The default values are set to:
110
- ```
122
+
123
+ ```
111
124
radius = 2;
112
125
shadowOffsetWidth = 0;
113
126
shadowOffsetHeight = 2;
@@ -120,33 +133,32 @@ shadowRadius = 1;
120
133
121
134
#### Android
122
135
123
- Sample 1 | Sample 2
124
- -------- | ---------
125
- ![ Sample1] ( images/sample_card1.png ) | ![ Sample2] ( images/sample_card2.png )
126
-
136
+ | Sample 1 | Sample 2 |
137
+ | ----------------------------------- | ----------------------------------- |
138
+ | ![ Sample1] ( images/sample_card1.png ) | ![ Sample2] ( images/sample_card2.png ) |
127
139
128
140
#### iOS
129
141
130
- Sample 1 | Sample 2
131
- -------- | ---------
132
- ![ Sample1] ( images/sample_card1_ios.png ) | ![ Sample2] ( images/sample_card3_ios.png )
133
-
142
+ | Sample 1 | Sample 2 |
143
+ | --------------------------------------- | --------------------------------------- |
144
+ | ![ Sample1] ( images/sample_card1_ios.png ) | ![ Sample2] ( images/sample_card3_ios.png ) |
134
145
135
146
#### Contributing
147
+
136
148
[ Please follow here] ( https://github.com/bradmartin/nativescript-cardview/blob/master/CONTRIBUTING.md )
137
149
138
150
#### Contributors
139
151
140
- [ <img alt =" bradmartin " src =" https://avatars3.githubusercontent.com/u/6006148?v=3&s=117 " width =" 117 " >] ( https://github.com/bradmartin ) |[ <img alt =" NathanWalker " src =" https://avatars1.githubusercontent.com/u/457187?v=3&s=117 " width =" 117 " >] ( https://github.com/NathanWalker ) |[ <img alt =" manijak " src =" https://avatars3.githubusercontent.com/u/3605066?v=3&s=117 " width =" 117 " >] ( https://github.com/manijak ) |[ <img alt =" NathanaelA " src =" https://avatars0.githubusercontent.com/u/850871?v=3&s=117 " width =" 117 " >] ( https://github.com/NathanaelA ) |[ <img alt =" EddyVerbruggen " src =" https://avatars2.githubusercontent.com/u/1426370?v=3&s=117 " width =" 117 " >] ( https://github.com/EddyVerbruggen ) |[ <img alt =" sis0k0 " src =" https://avatars1.githubusercontent.com/u/7893485?v=3&s=117 " width =" 117 " >] ( https://github.com/sis0k0 ) |
141
- :---: |:---: |:---: |:---: |:---: |:---: |
142
- [ bradmartin] ( https://github.com/bradmartin ) |[ NathanWalker] ( https://github.com/NathanWalker ) |[ manijak] ( https://github.com/manijak ) |[ NathanaelA] ( https://github.com/NathanaelA ) |[ EddyVerbruggen] ( https://github.com/EddyVerbruggen ) |[ sis0k0] ( https://github.com/sis0k0 ) |
143
-
144
- [ <img alt =" vladimirnani " src =" https://avatars0.githubusercontent.com/u/3397077?v=3&s=117 " width =" 117 " >] ( https://github.com/vladimirnani ) |[ <img alt =" DickSmith " src =" https://avatars0.githubusercontent.com/u/6675511?v=3&s=117 " width =" 117 " >] ( https://github.com/DickSmith ) |
145
- :---: |:---: |
146
- [ vladimirnani] ( https://github.com/vladimirnani ) |[ DickSmith] ( https://github.com/DickSmith ) |
152
+ | [ <img alt =" bradmartin " src =" https://avatars3.githubusercontent.com/u/6006148?v=3&s=117 " width =" 117 " >] ( https://github.com/bradmartin ) | [ <img alt =" NathanWalker " src =" https://avatars1.githubusercontent.com/u/457187?v=3&s=117 " width =" 117 " >] ( https://github.com/NathanWalker ) | [ <img alt =" manijak " src =" https://avatars3.githubusercontent.com/u/3605066?v=3&s=117 " width =" 117 " >] ( https://github.com/manijak ) | [ <img alt =" NathanaelA " src =" https://avatars0.githubusercontent.com/u/850871?v=3&s=117 " width =" 117 " >] ( https://github.com/NathanaelA ) | [ <img alt =" EddyVerbruggen " src =" https://avatars2.githubusercontent.com/u/1426370?v=3&s=117 " width =" 117 " >] ( https://github.com/EddyVerbruggen ) | [ <img alt =" sis0k0 " src =" https://avatars1.githubusercontent.com/u/7893485?v=3&s=117 " width =" 117 " >] ( https://github.com/sis0k0 ) |
153
+ | :----------------------------------------------------------------------------------------------------------------------------------: | :-------------------------------------------------------------------------------------------------------------------------------------: | :----------------------------------------------------------------------------------------------------------------------------: | :---------------------------------------------------------------------------------------------------------------------------------: | :------------------------------------------------------------------------------------------------------------------------------------------: | :--------------------------------------------------------------------------------------------------------------------------: |
154
+ | [ bradmartin] ( https://github.com/bradmartin ) | [ NathanWalker] ( https://github.com/NathanWalker ) | [ manijak] ( https://github.com/manijak ) | [ NathanaelA] ( https://github.com/NathanaelA ) | [ EddyVerbruggen] ( https://github.com/EddyVerbruggen ) | [ sis0k0] ( https://github.com/sis0k0 ) |
147
155
156
+ | [ <img alt =" vladimirnani " src =" https://avatars0.githubusercontent.com/u/3397077?v=3&s=117 " width =" 117 " >] ( https://github.com/vladimirnani ) | [ <img alt =" DickSmith " src =" https://avatars0.githubusercontent.com/u/6675511?v=3&s=117 " width =" 117 " >] ( https://github.com/DickSmith ) |
157
+ | :--------------------------------------------------------------------------------------------------------------------------------------: | :--------------------------------------------------------------------------------------------------------------------------------: |
158
+ | [ vladimirnani] ( https://github.com/vladimirnani ) | [ DickSmith] ( https://github.com/DickSmith ) |
148
159
149
160
## [ nStudio, LLC] ( http://nstudio.io )
150
- [ ![ nStudio] ( ./images/nstudio-banner.png " nStudio ")] ( http://nStudio.io )
151
161
152
- Do you need assistance on your project or plugin? Contact the nStudio team anytime at
< [email protected] > to get up to speed with the best practices in mobile and web app development.
162
+ [ ![ nStudio] ( ./images/nstudio-banner.png ' nStudio ')] ( http://nStudio.io )
163
+
164
+ Do you need assistance on your project or plugin? Contact the nStudio team anytime at
< mailto:[email protected] > to get up to speed with the best practices in mobile and web app development.
0 commit comments