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
712f0979
Commit
712f0979
authored
Feb 11, 2016
by
Daniel Dahan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
added GridAxis to Grid
parent
0dd6009b
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
7 deletions
+7
-7
Examples/Programmatic/GridView/GridView/ViewController.swift
+2
-2
Sources/Grid.swift
+5
-5
No files found.
Examples/Programmatic/GridView/GridView/ViewController.swift
View file @
712f0979
...
...
@@ -67,7 +67,7 @@ class ViewController: UIViewController {
let
contentView
:
MaterialView
=
MaterialView
()
contentView
.
grid
.
column
=
.
Column8
contentView
.
grid
.
layout
=
.
Vertical
contentView
.
grid
.
axis
=
.
Vertical
contentView
.
grid
.
contentInsetPreset
=
.
Square3
contentView
.
grid
.
spacing
=
16
contentView
.
backgroundColor
=
MaterialColor
.
clear
...
...
@@ -233,7 +233,7 @@ class ViewController: UIViewController {
label2
.
text
=
"B"
label2
.
backgroundColor
=
MaterialColor
.
blue
.
base
view
.
grid
.
layout
=
.
Vertical
view
.
grid
.
axis
=
.
Vertical
view
.
grid
.
row
=
.
Row9
view
.
grid
.
spacing
=
16
view
.
grid
.
contentInset
.
left
=
16
...
...
Sources/Grid.swift
View file @
712f0979
...
...
@@ -60,7 +60,7 @@ public enum GridColumn : Int {
case
Column12
=
12
}
public
enum
Grid
Layout
{
public
enum
Grid
Axis
{
case
Horizontal
case
Vertical
}
...
...
@@ -115,8 +115,8 @@ public class Grid {
}
}
/// The
direction in which the animation opens the menu
.
public
var
layout
:
GridLayout
=
.
Horizontal
{
/// The
axis in which the Grid is laying out its views
.
public
var
axis
:
GridAxis
=
.
Horizontal
{
didSet
{
reloadLayout
()
}
...
...
@@ -149,7 +149,7 @@ public class Grid {
let
r
:
Int
=
view
.
grid
.
row
.
rawValue
let
co
:
Int
=
nil
==
view
.
grid
.
columnOffset
?
0
:
view
.
grid
.
columnOffset
!.
rawValue
let
ro
:
Int
=
nil
==
view
.
grid
.
rowOffset
?
0
:
view
.
grid
.
rowOffset
!.
rawValue
if
.
Horizontal
==
layout
{
if
.
Horizontal
==
axis
{
// View height.
let
vh
:
CGFloat
=
sv
.
bounds
.
height
-
contentInset
.
top
-
contentInset
.
bottom
...
...
@@ -167,7 +167,7 @@ public class Grid {
}
else
{
view
.
frame
=
CGRectMake
(
vl
,
contentInset
.
top
,
vw
,
vh
)
}
}
else
if
.
Vertical
==
layout
{
}
else
if
.
Vertical
==
axis
{
// View width.
let
vw
:
CGFloat
=
sv
.
bounds
.
width
-
contentInset
.
left
-
contentInset
.
right
...
...
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