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
14a9756e
Commit
14a9756e
authored
Oct 12, 2017
by
Daniel Dahan
Committed by
GitHub
Oct 12, 2017
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #904 from mohpor/development
Introducing tabBarItemsNormalColor and tabBarItemsSelectedColor
parents
af62cb93
da219e20
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
26 additions
and
3 deletions
+26
-3
Sources/iOS/Button.swift
+8
-0
Sources/iOS/TabBar.swift
+18
-3
No files found.
Sources/iOS/Button.swift
View file @
14a9756e
...
@@ -131,6 +131,14 @@ open class Button: UIButton, Pulseable, PulseableLayer {
...
@@ -131,6 +131,14 @@ open class Button: UIButton, Pulseable, PulseableLayer {
setTitleColor
(
titleColor
,
for
:
.
highlighted
)
setTitleColor
(
titleColor
,
for
:
.
highlighted
)
}
}
}
}
/// Sets the selected titleColor for the button.
@IBInspectable
open
var
selectedTitleColor
:
UIColor
?
{
didSet
{
setTitleColor
(
selectedTitleColor
,
for
:
.
selected
)
}
}
/**
/**
An initializer that initializes the object with a NSCoder object.
An initializer that initializes the object with a NSCoder object.
...
...
Sources/iOS/TabBar.swift
View file @
14a9756e
...
@@ -139,7 +139,14 @@ open class TabBar: Bar {
...
@@ -139,7 +139,14 @@ open class TabBar: Bar {
internal
weak
var
_delegate
:
_TabBarDelegate
?
internal
weak
var
_delegate
:
_TabBarDelegate
?
/// The currently selected tabItem.
/// The currently selected tabItem.
open
internal(set)
var
selectedTabItem
:
TabItem
?
open
internal(set)
var
selectedTabItem
:
TabItem
?
{
willSet
{
selectedTabItem
?
.
isSelected
=
false
}
didSet
{
selectedTabItem
?
.
isSelected
=
true
}
}
/// A preset wrapper around tabItems contentEdgeInsets.
/// A preset wrapper around tabItems contentEdgeInsets.
open
var
tabItemsContentEdgeInsetsPreset
:
EdgeInsetsPreset
{
open
var
tabItemsContentEdgeInsetsPreset
:
EdgeInsetsPreset
{
...
@@ -194,7 +201,13 @@ open class TabBar: Bar {
...
@@ -194,7 +201,13 @@ open class TabBar: Bar {
layoutSubviews
()
layoutSubviews
()
}
}
}
}
/// TabBar items normal title color.
open
var
tabItemsNormalTitleColor
:
UIColor
?
/// TabBar items selected title color.
open
var
tabItemsSelectedTitleColor
:
UIColor
?
/// A reference to the line UIView.
/// A reference to the line UIView.
open
let
line
=
UIView
()
open
let
line
=
UIView
()
...
@@ -272,7 +285,9 @@ fileprivate extension TabBar {
...
@@ -272,7 +285,9 @@ fileprivate extension TabBar {
for
v
in
tabItems
{
for
v
in
tabItems
{
v
.
grid
.
columns
=
0
v
.
grid
.
columns
=
0
v
.
contentEdgeInsets
=
.
zero
v
.
contentEdgeInsets
=
.
zero
if
Color
.
blue
.
base
==
v
.
titleColor
{
v
.
titleColor
=
tabItemsNormalTitleColor
}
if
nil
==
v
.
selectedTitleColor
{
v
.
selectedTitleColor
=
tabItemsSelectedTitleColor
}
prepareLineAnimationHandler
(
tabItem
:
v
)
prepareLineAnimationHandler
(
tabItem
:
v
)
}
}
...
...
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