Commit 6d917815 by Daniel Dahan

updated MaterialView example

parent 975085e3
{
"images" : [
{
"idiom" : "universal",
"filename" : "ChakraIcon.png",
"scale" : "1x"
},
{
"idiom" : "universal",
"filename" : "ChakraIcon@2x.png",
"scale" : "2x"
},
{
"idiom" : "universal",
"filename" : "ChakraIcon@3x.png",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
\ No newline at end of file
...@@ -41,13 +41,11 @@ class ViewController: UIViewController { ...@@ -41,13 +41,11 @@ class ViewController: UIViewController {
:description: General usage example. :description: General usage example.
*/ */
private func prepareGeneralMaterialViewExample() { private func prepareGeneralMaterialViewExample() {
let materialView: MaterialView = MaterialView(frame: CGRectMake(7, 100, 400, 400)) let materialView: MaterialView = MaterialView(frame: CGRectMake(107, 107, 200, 200))
materialView.backgroundColor = MaterialColor.deepPurple.lighten1 materialView.image = UIImage(named: "Flower")
materialView.image = UIImage(named: "ChakraIcon")
materialView.contentsGravity = .BottomRight
materialView.shape = .Square materialView.shape = .Square
materialView.shadowDepth = .Depth2 materialView.shadowDepth = .Depth5
materialView.cornerRadius = .Radius2 materialView.cornerRadius = .Radius3
// Add view to view controller. // Add view to view controller.
......
...@@ -23,18 +23,16 @@ materialLayer.shadowDepth = .Depth2 ...@@ -23,18 +23,16 @@ materialLayer.shadowDepth = .Depth2
### MaterialView ### MaterialView
MaterialView is the base UIView class used throughout MaterialKit. Like MaterialLayer, it is designed to easily take shape, depth, and animations. The major difference is that MaterialView has all the added features of the UIView class. Below is an example of setting a MaterialView's cornerRadius, image position, shape, and depth. MaterialView is the base UIView class used throughout MaterialKit. Like MaterialLayer, it is designed to easily take shape, depth, and animations. The major difference is that MaterialView has all the added features of the UIView class. Below is an example of setting a MaterialView's cornerRadius, shape, and depth.
![MaterialKitMaterialView](http://www.materialkit.io/MK/MaterialKitMaterialView.gif) ![MaterialKitMaterialView](http://www.materialkit.io/MK/MaterialKitMaterialView.gif)
```swift ```swift
let materialView: MaterialView = MaterialView(frame: CGRectMake(7, 100, 400, 400)) let materialView: MaterialView = MaterialView(frame: CGRectMake(107, 107, 200, 200))
materialView.backgroundColor = MaterialColor.deepPurple.lighten1 materialView.image = UIImage(named: "Flower")
materialView.image = UIImage(named: "ChakraIcon")
materialView.contentsGravity = .BottomRight
materialView.shape = .Square materialView.shape = .Square
materialView.shadowDepth = .Depth2 materialView.shadowDepth = .Depth5
materialView.cornerRadius = .Radius2 materialView.cornerRadius = .Radius3
``` ```
### MaterialPulseView ### MaterialPulseView
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment