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
fbd6fdef
Unverified
Commit
fbd6fdef
authored
Aug 27, 2016
by
Daniel Dahan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
development: added PageTabBarAlignment
parent
2cd1c58e
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
21 additions
and
5 deletions
+21
-5
Sources/iOS/PageTabBarController.swift
+20
-4
Sources/iOS/TabBar.swift
+1
-1
No files found.
Sources/iOS/PageTabBarController.swift
View file @
fbd6fdef
...
...
@@ -47,6 +47,12 @@ open class PageTabBar: TabBar {
}
}
@objc(PageTabBarAlignment)
public
enum
PageTabBarAlignment
:
Int
{
case
top
case
bottom
}
/// Grid extension for UIView.
extension
UIViewController
{
/// Grid reference.
...
...
@@ -93,6 +99,9 @@ open class PageTabBarController: RootController {
/// The currently selected UIViewController.
open
internal(set)
var
selectedIndex
:
Int
=
0
/// PageTabBar alignment setting.
open
var
pageTabBarAlignment
=
PageTabBarAlignment
.
top
/// Reference to the PageTabBar.
open
internal(set)
var
pageTabBar
:
PageTabBar
!
...
...
@@ -140,13 +149,20 @@ open class PageTabBarController: RootController {
let
p
=
v
.
intrinsicContentSize
.
height
+
v
.
grid
.
layoutEdgeInsets
.
top
+
v
.
grid
.
layoutEdgeInsets
.
bottom
let
y
=
h
-
p
v
.
y
=
y
v
.
width
=
w
+
v
.
grid
.
layoutEdgeInsets
.
left
+
v
.
grid
.
layoutEdgeInsets
.
right
v
.
height
=
p
v
.
width
=
w
+
v
.
grid
.
layoutEdgeInsets
.
left
+
v
.
grid
.
layoutEdgeInsets
.
right
rootViewController
.
view
.
y
=
0
rootViewController
.
view
.
height
=
y
switch
pageTabBarAlignment
{
case
.
top
:
v
.
y
=
0
rootViewController
.
view
.
y
=
p
case
.
bottom
:
v
.
y
=
y
rootViewController
.
view
.
y
=
0
}
v
.
divider
.
reload
()
}
...
...
@@ -300,6 +316,6 @@ extension PageTabBarController: UIScrollViewDelegate {
let
x
=
(
scrollView
.
contentOffset
.
x
-
view
.
width
)
/
scrollView
.
contentSize
.
width
*
view
.
width
pageTabBar
.
line
.
x
=
selected
.
x
+
x
pageTabBar
.
line
.
x
=
selected
.
x
+
x
// - (0 < selectedIndex ? pageTabBar.grid.interimSpace * CGFloat(selectedIndex - 1) : 0)
}
}
Sources/iOS/TabBar.swift
View file @
fbd6fdef
...
...
@@ -247,7 +247,7 @@ open class TabBar: View {
*/
open
override
func
prepareView
()
{
super
.
prepareView
()
interimSpacePreset
=
.
interimSpace1
interimSpacePreset
=
.
none
contentEdgeInsetsPreset
=
.
none
autoresizingMask
=
.
flexibleWidth
prepareLine
()
...
...
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