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
7720770c
Unverified
Commit
7720770c
authored
Jul 20, 2017
by
Daniel Dahan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
development: removed scrollable feature from TabBar until the feature is ready
parent
ae52f778
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
24 additions
and
24 deletions
+24
-24
Sources/iOS/TabBar.swift
+24
-24
No files found.
Sources/iOS/TabBar.swift
View file @
7720770c
...
...
@@ -60,7 +60,7 @@ public protocol TabBarDelegate {
@objc(TabBarStyle)
public
enum
TabBarStyle
:
Int
{
case
normal
case
scrollable
//
case scrollable
}
open
class
TabBar
:
Bar
{
...
...
@@ -78,7 +78,7 @@ open class TabBar: Bar {
}
/// An enum that determines the tab bar style.
open
var
tabBarStyle
=
TabBarStyle
.
scrollable
{
open
var
tabBarStyle
=
TabBarStyle
.
normal
{
didSet
{
layoutSubviews
()
}
...
...
@@ -270,32 +270,32 @@ open class TabBar: Bar {
layoutDivider
()
let
buttonsWidth
=
buttons
.
reduce
(
0
)
{
$0
+
$1
.
sizeThatFits
(
CGSize
(
width
:
.
greatestFiniteMagnitude
,
height
:
contentView
.
height
))
.
width
+
interimSpace
}
//
let buttonsWidth = buttons.reduce(0) {
//
$0 + $1.sizeThatFits(CGSize(width: .greatestFiniteMagnitude, height: contentView.height)).width + interimSpace
//
}
if
.
scrollable
==
tabBarStyle
&&
buttonsWidth
>
p
{
scrollView
.
frame
=
CGRect
(
x
:
l
,
y
:
0
,
width
:
p
,
height
:
height
)
var
w
:
CGFloat
=
0
for
b
in
buttons
{
let
width
=
b
.
sizeThatFits
(
CGSize
(
width
:
CGFloat
.
greatestFiniteMagnitude
,
height
:
contentView
.
height
))
.
width
+
interimSpace
scrollView
.
addSubview
(
b
)
b
.
height
=
scrollView
.
height
b
.
width
=
width
b
.
x
=
w
w
+=
width
}
scrollView
.
contentSize
=
CGSize
(
width
:
buttonsWidth
,
height
:
height
)
scrollView
.
addSubview
(
line
)
}
else
{
//
if .scrollable == tabBarStyle && buttonsWidth > p {
//
scrollView.frame = CGRect(x: l, y: 0, width: p, height: height)
//
//
var w: CGFloat = 0
//
//
for b in buttons {
//
let width = b.sizeThatFits(CGSize(width: CGFloat.greatestFiniteMagnitude, height: contentView.height)).width + interimSpace
//
scrollView.addSubview(b)
//
b.height = scrollView.height
//
b.width = width
//
b.x = w
//
w += width
//
}
//
//
scrollView.contentSize = CGSize(width: buttonsWidth, height: height)
//
scrollView.addSubview(line)
//
} else {
contentView
.
grid
.
axis
.
columns
=
buttons
.
count
centerViews
=
buttons
addSubview
(
line
)
}
//
}
updateSelectionLine
()
}
...
...
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