Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
M
Material
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Dmitriy Stepanets
Material
Commits
a70e2660
Commit
a70e2660
authored
Dec 06, 2015
by
Daniel Dahan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
added ImageCardView example 2
parent
2f41ae65
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
70 additions
and
1 deletions
+70
-1
Examples/ImageCardView/ImageCardView/Assets.xcassets/Contents.json
+7
-0
Examples/ImageCardView/ImageCardView/ViewController.swift
+59
-1
README.md
+4
-0
No files found.
Examples/ImageCardView/ImageCardView/Assets.xcassets/Contents.json
0 → 100644
View file @
a70e2660
{
"info"
:
{
"version"
:
1
,
"author"
:
"xcode"
}
}
\ No newline at end of file
Examples/ImageCardView/ImageCardView/ViewController.swift
View file @
a70e2660
...
...
@@ -40,7 +40,8 @@ class ViewController: UIViewController {
// Examples of using CardView.
// Uncomment different examples and read
// the comments below.
prepareGeneralImageCardViewExample
()
// prepareGeneralImageCardViewExample()
prepareImageCardViewWithoutDetailLabelAndDividerExample
()
}
/**
...
...
@@ -99,6 +100,63 @@ class ViewController: UIViewController {
imageCardView
.
translatesAutoresizingMaskIntoConstraints
=
false
MaterialLayout
.
alignFromTop
(
view
,
child
:
imageCardView
,
top
:
100
)
MaterialLayout
.
alignToParentHorizontally
(
view
,
child
:
imageCardView
,
left
:
20
,
right
:
20
)
}
/**
:name: prepareImageCardViewWithoutDetailLabelAndDividerExample
:description: The following example removes the detailLabel to create a new look and feel to the general example.
*/
private
func
prepareImageCardViewWithoutDetailLabelAndDividerExample
()
{
let
imageCardView
:
ImageCardView
=
ImageCardView
()
imageCardView
.
divider
=
false
// Image.
imageCardView
.
image
=
UIImage
(
named
:
"MaterialKitImageCardViewBackgroundImage"
)
// Title label.
let
titleLabel
:
UILabel
=
UILabel
()
titleLabel
.
text
=
"Material Design"
titleLabel
.
textColor
=
MaterialColor
.
white
titleLabel
.
font
=
RobotoFont
.
regularWithSize
(
24
)
imageCardView
.
titleLabel
=
titleLabel
imageCardView
.
titleLabelInsetsRef
.
top
=
80
// Check button.
let
img1
:
UIImage
?
=
UIImage
(
named
:
"ic_check_blue_grey_darken_4"
)
let
btn1
:
FlatButton
=
FlatButton
()
btn1
.
pulseColor
=
MaterialColor
.
blueGrey
.
lighten1
btn1
.
pulseFill
=
true
btn1
.
pulseScale
=
false
btn1
.
setImage
(
img1
,
forState
:
.
Normal
)
btn1
.
setImage
(
img1
,
forState
:
.
Highlighted
)
// Star button.
let
img2
:
UIImage
?
=
UIImage
(
named
:
"ic_star_blue_grey_darken_4"
)
let
btn2
:
FlatButton
=
FlatButton
()
btn2
.
pulseColor
=
MaterialColor
.
blueGrey
.
lighten1
btn2
.
pulseFill
=
true
btn2
.
pulseScale
=
false
btn2
.
setImage
(
img2
,
forState
:
.
Normal
)
btn2
.
setImage
(
img2
,
forState
:
.
Highlighted
)
// Delete button.
let
img3
:
UIImage
?
=
UIImage
(
named
:
"ic_delete_blue_grey_darken_4"
)
let
btn3
:
FlatButton
=
FlatButton
()
btn3
.
pulseColor
=
MaterialColor
.
blueGrey
.
lighten1
btn3
.
pulseFill
=
true
btn3
.
pulseScale
=
false
btn3
.
setImage
(
img3
,
forState
:
.
Normal
)
btn3
.
setImage
(
img3
,
forState
:
.
Highlighted
)
// Add buttons to right side.
imageCardView
.
rightButtons
=
[
btn1
,
btn2
,
btn3
]
imageCardView
.
rightButtonsInsetsRef
.
top
=
imageCardView
.
contentInsetsRef
.
top
// To support orientation changes, use MaterialLayout.
view
.
addSubview
(
imageCardView
)
imageCardView
.
translatesAutoresizingMaskIntoConstraints
=
false
MaterialLayout
.
alignFromTop
(
view
,
child
:
imageCardView
,
top
:
100
)
MaterialLayout
.
alignToParentHorizontally
(
view
,
child
:
imageCardView
,
left
:
20
,
right
:
20
)
}
}
...
...
README.md
View file @
a70e2660
...
...
@@ -42,6 +42,10 @@ Bold and attractive, ImageCardView is the next step from a CardView. In the Exam

Remove elements, such as the details to create fresh looks for your images.

### License
[
AGPL-3.0
](
http://choosealicense.com/licenses/agpl-3.0/
)
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment