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
d12b0cb0
Unverified
Commit
d12b0cb0
authored
May 22, 2017
by
Daniel Dahan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
development: updated frame calculation for TabBar scroll view
parent
50a60baf
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
8 deletions
+9
-8
Sources/iOS/TabBar.swift
+6
-4
Sources/iOS/TabsController.swift
+3
-4
No files found.
Sources/iOS/TabBar.swift
View file @
d12b0cb0
...
@@ -215,8 +215,8 @@ open class TabBar: Bar {
...
@@ -215,8 +215,8 @@ open class TabBar: Bar {
for
b
in
buttons
{
for
b
in
buttons
{
let
width
=
b
.
sizeThatFits
(
CGSize
(
width
:
CGFloat
.
greatestFiniteMagnitude
,
height
:
contentView
.
height
))
.
width
+
interimSpace
let
width
=
b
.
sizeThatFits
(
CGSize
(
width
:
CGFloat
.
greatestFiniteMagnitude
,
height
:
contentView
.
height
))
.
width
+
interimSpace
content
View
.
addSubview
(
b
)
scroll
View
.
addSubview
(
b
)
b
.
height
=
content
View
.
height
b
.
height
=
scroll
View
.
height
b
.
width
=
width
b
.
width
=
width
b
.
x
=
w
b
.
x
=
w
w
+=
width
w
+=
width
...
@@ -230,10 +230,12 @@ open class TabBar: Bar {
...
@@ -230,10 +230,12 @@ open class TabBar: Bar {
centerViews
=
buttons
centerViews
=
buttons
}
}
scrollView
.
frame
=
contentView
.
bounds
if
nil
==
selected
{
if
nil
==
selected
{
selected
=
buttons
.
first
selected
=
buttons
.
first
}
}
line
.
frame
=
CGRect
(
x
:
selected
!.
x
,
y
:
.
bottom
==
lineAlignment
?
height
-
lineHeight
:
0
,
width
:
selected
!.
width
,
height
:
lineHeight
)
line
.
frame
=
CGRect
(
x
:
selected
!.
x
,
y
:
.
bottom
==
lineAlignment
?
height
-
lineHeight
:
0
,
width
:
selected
!.
width
,
height
:
lineHeight
)
}
}
...
@@ -260,7 +262,7 @@ extension TabBar {
...
@@ -260,7 +262,7 @@ extension TabBar {
line
.
zPosition
=
6000
line
.
zPosition
=
6000
lineColor
=
Color
.
blue
.
base
lineColor
=
Color
.
blue
.
base
lineHeight
=
3
lineHeight
=
3
addSubview
(
line
)
scrollView
.
addSubview
(
line
)
}
}
/// Prepares the divider.
/// Prepares the divider.
...
...
Sources/iOS/TabsController.swift
View file @
d12b0cb0
...
@@ -375,8 +375,7 @@ extension TabsController {
...
@@ -375,8 +375,7 @@ extension TabsController {
return
return
}
}
let
p
=
v
.
height
let
y
=
view
.
height
-
v
.
height
let
y
=
view
.
height
-
p
v
.
width
=
view
.
width
v
.
width
=
view
.
width
...
@@ -472,7 +471,7 @@ extension TabsController {
...
@@ -472,7 +471,7 @@ extension TabsController {
removeViewControllers
()
removeViewControllers
()
prepareViewControllersForTransition
(
from
:
selectedIndex
,
to
:
i
)
//
prepareViewControllersForTransition(from: selectedIndex, to: i)
selectedIndex
=
i
selectedIndex
=
i
v
.
select
(
at
:
i
)
v
.
select
(
at
:
i
)
...
@@ -492,7 +491,7 @@ extension TabsController: UIScrollViewDelegate {
...
@@ -492,7 +491,7 @@ extension TabsController: UIScrollViewDelegate {
removeViewControllers
()
removeViewControllers
()
prepareViewControllers
()
prepareViewControllers
()
prepareTabBar
()
//
prepareTabBar()
layoutSubviews
()
layoutSubviews
()
}
}
}
}
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