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
8611b3c7
Unverified
Commit
8611b3c7
authored
Oct 12, 2017
by
M. Porooshani
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
refs #860 adds better handling of TabBar items' colors
parent
af62cb93
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
33 additions
and
3 deletions
+33
-3
Sources/iOS/Button.swift
+8
-0
Sources/iOS/TabBar.swift
+25
-3
No files found.
Sources/iOS/Button.swift
View file @
8611b3c7
...
...
@@ -131,6 +131,14 @@ open class Button: UIButton, Pulseable, PulseableLayer {
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.
...
...
Sources/iOS/TabBar.swift
View file @
8611b3c7
...
...
@@ -139,7 +139,14 @@ open class TabBar: Bar {
internal
weak
var
_delegate
:
_TabBarDelegate
?
/// 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.
open
var
tabItemsContentEdgeInsetsPreset
:
EdgeInsetsPreset
{
...
...
@@ -194,7 +201,20 @@ open class TabBar: Bar {
layoutSubviews
()
}
}
/// Tab bars normal title color.
open
var
tabItemsNormalTitleColor
:
UIColor
?
{
didSet
{
}
}
open
var
tabItemsSelectedTitleColor
:
UIColor
?
{
didSet
{
}
}
/// A reference to the line UIView.
open
let
line
=
UIView
()
...
...
@@ -272,7 +292,9 @@ fileprivate extension TabBar {
for
v
in
tabItems
{
v
.
grid
.
columns
=
0
v
.
contentEdgeInsets
=
.
zero
if
Color
.
blue
.
base
==
v
.
titleColor
{
v
.
titleColor
=
tabItemsNormalTitleColor
}
if
nil
==
v
.
selectedTitleColor
{
v
.
selectedTitleColor
=
tabItemsSelectedTitleColor
}
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