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
e577cfa3
Commit
e577cfa3
authored
May 19, 2016
by
Daniel Dahan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
updated ControlView dynamic height - respecting now height specified
parent
418dc317
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
16 additions
and
13 deletions
+16
-13
Sources/iOS/BarView.swift
+0
-4
Sources/iOS/ControlView.swift
+5
-1
Sources/iOS/SearchBarController.swift
+5
-4
Sources/iOS/Toolbar.swift
+1
-0
Sources/iOS/ToolbarController.swift
+5
-4
No files found.
Sources/iOS/BarView.swift
View file @
e577cfa3
...
...
@@ -83,9 +83,5 @@ public class BarView : ControlView {
public
override
func
prepareView
()
{
super
.
prepareView
()
depth
=
.
Depth1
spacingPreset
=
.
Spacing1
contentInsetPreset
=
.
Square1
autoresizingMask
=
.
FlexibleWidth
shadowPathAutoSizeEnabled
=
false
}
}
Sources/iOS/ControlView.swift
View file @
e577cfa3
...
...
@@ -136,6 +136,7 @@ public class ControlView : MaterialView {
public
init
()
{
super
.
init
(
frame
:
CGRectZero
)
frame
.
size
=
intrinsicContentSize
()
frame
.
size
.
width
=
MaterialDevice
.
width
prepareView
()
}
...
...
@@ -154,7 +155,6 @@ public class ControlView : MaterialView {
super
.
layoutSubviews
()
if
willRenderView
{
layoutIfNeeded
()
frame
.
size
.
height
=
intrinsicContentSize
()
.
height
let
factor
:
CGFloat
=
24
if
let
g
:
Int
=
Int
(
width
/
factor
)
{
...
...
@@ -222,6 +222,10 @@ public class ControlView : MaterialView {
*/
public
override
func
prepareView
()
{
super
.
prepareView
()
spacingPreset
=
.
Spacing1
contentInsetPreset
=
.
Square1
autoresizingMask
=
.
FlexibleWidth
shadowPathAutoSizeEnabled
=
false
prepareContentView
()
}
...
...
Sources/iOS/SearchBarController.swift
View file @
e577cfa3
...
...
@@ -59,18 +59,19 @@ public class SearchBarController : BarViewController {
/// Layout subviews.
public
func
layoutSubviews
()
{
let
w
:
CGFloat
=
MaterialDevice
.
width
let
h
:
CGFloat
=
MaterialDevice
.
height
if
.
iPhone
==
MaterialDevice
.
type
&&
MaterialDevice
.
isLandscape
{
searchBar
.
contentInset
.
top
=
4
}
else
{
searchBar
.
contentInset
.
top
=
24
}
let
h
:
CGFloat
=
MaterialDevice
.
height
let
w
:
CGFloat
=
MaterialDevice
.
width
let
p
:
CGFloat
=
searchBar
.
intrinsicContentSize
()
.
height
searchBar
.
width
=
w
searchBar
.
height
=
p
let
p
:
CGFloat
=
searchBar
.
intrinsicContentSize
()
.
height
rootViewController
.
view
.
frame
.
origin
.
y
=
p
rootViewController
.
view
.
frame
.
size
.
height
=
h
-
p
}
...
...
Sources/iOS/Toolbar.swift
View file @
e577cfa3
...
...
@@ -77,6 +77,7 @@ public class Toolbar : BarView {
/// Basic initializer.
public
override
init
()
{
super
.
init
()
print
(
"Toolbar"
,
intrinsicContentSize
())
}
/**
...
...
Sources/iOS/ToolbarController.swift
View file @
e577cfa3
...
...
@@ -146,18 +146,19 @@ public class ToolbarController : BarViewController {
/// Layout subviews.
public
func
layoutSubviews
()
{
let
w
:
CGFloat
=
MaterialDevice
.
width
let
h
:
CGFloat
=
MaterialDevice
.
height
if
.
iPhone
==
MaterialDevice
.
type
&&
MaterialDevice
.
isLandscape
{
toolbar
.
contentInset
.
top
=
4
}
else
{
toolbar
.
contentInset
.
top
=
24
}
let
h
:
CGFloat
=
MaterialDevice
.
height
let
w
:
CGFloat
=
MaterialDevice
.
width
let
p
:
CGFloat
=
toolbar
.
intrinsicContentSize
()
.
height
toolbar
.
width
=
w
toolbar
.
height
=
p
let
p
:
CGFloat
=
toolbar
.
intrinsicContentSize
()
.
height
rootViewController
.
view
.
frame
.
origin
.
y
=
p
rootViewController
.
view
.
frame
.
size
.
height
=
h
-
p
}
...
...
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