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
fd00b5e3
Commit
fd00b5e3
authored
Mar 25, 2016
by
Daniel Dahan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
updated BottomNavigationBar color settings
parent
42e249cb
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
18 additions
and
37 deletions
+18
-37
Examples/Programmatic/BottomNavigationBar/BottomNavigationBar/Assets.xcassets/ic_music_note_white.imageset/Contents.json
+0
-24
Examples/Programmatic/BottomNavigationBar/BottomNavigationBar/Assets.xcassets/ic_music_note_white.imageset/ic_music_note_white.png
+0
-0
Examples/Programmatic/BottomNavigationBar/BottomNavigationBar/Assets.xcassets/ic_music_note_white.imageset/ic_music_note_white_2x.png
+0
-0
Examples/Programmatic/BottomNavigationBar/BottomNavigationBar/Assets.xcassets/ic_music_note_white.imageset/ic_music_note_white_3x.png
+0
-0
Examples/Programmatic/BottomNavigationBar/BottomNavigationBar/ViewController.swift
+11
-11
Sources/BottomNavigationBar.swift
+5
-0
Sources/BottomNavigationBarItem.swift
+2
-2
No files found.
Examples/Programmatic/BottomNavigationBar/BottomNavigationBar/Assets.xcassets/ic_music_note_white.imageset/Contents.json
deleted
100644 → 0
View file @
42e249cb
{
"images"
:
[
{
"idiom"
:
"universal"
,
"filename"
:
"ic_music_note_white.png"
,
"scale"
:
"1x"
},
{
"idiom"
:
"universal"
,
"filename"
:
"ic_music_note_white_2x.png"
,
"scale"
:
"2x"
},
{
"idiom"
:
"universal"
,
"filename"
:
"ic_music_note_white_3x.png"
,
"scale"
:
"3x"
}
],
"info"
:
{
"version"
:
1
,
"author"
:
"xcode"
}
}
\ No newline at end of file
Examples/Programmatic/BottomNavigationBar/BottomNavigationBar/Assets.xcassets/ic_music_note_white.imageset/ic_music_note_white.png
deleted
100644 → 0
View file @
42e249cb
142 Bytes
Examples/Programmatic/BottomNavigationBar/BottomNavigationBar/Assets.xcassets/ic_music_note_white.imageset/ic_music_note_white_2x.png
deleted
100644 → 0
View file @
42e249cb
219 Bytes
Examples/Programmatic/BottomNavigationBar/BottomNavigationBar/Assets.xcassets/ic_music_note_white.imageset/ic_music_note_white_3x.png
deleted
100644 → 0
View file @
42e249cb
291 Bytes
Examples/Programmatic/BottomNavigationBar/BottomNavigationBar/ViewController.swift
View file @
fd00b5e3
...
...
@@ -49,23 +49,23 @@ class ViewController: UIViewController {
/// Prepare bottomNavigationBar.
private
func
prepareBottomNavigationBar
()
{
bottomNavigationBar
=
BottomNavigationBar
()
bottomNavigationBar
.
backgroundColor
=
MaterialColor
.
teal
.
base
bottomNavigationBar
.
backgroundColor
=
MaterialColor
.
grey
.
darken4
view
.
addSubview
(
bottomNavigationBar
)
let
item1
:
BottomNavigationBarItem
=
BottomNavigationBarItem
(
title
:
"
Music"
,
image
:
UIImage
(
named
:
"ic_music_note_white"
)?
.
imageWithRenderingMode
(
.
AlwaysOriginal
),
selectedImage
:
UIImage
(
named
:
"ic_music_note
_white"
))
item1
.
setTitleColor
(
MaterialColor
.
whit
e
,
forState
:
.
Normal
)
item1
.
setTitleColor
(
MaterialColor
.
whit
e
,
forState
:
.
Selected
)
let
item1
:
BottomNavigationBarItem
=
BottomNavigationBarItem
(
title
:
"
Video"
,
image
:
UIImage
(
named
:
"ic_videocam_white"
)?
.
imageWithRenderingMode
(
.
AlwaysTemplate
),
selectedImage
:
UIImage
(
named
:
"ic_videocam
_white"
))
item1
.
setTitleColor
(
MaterialColor
.
grey
.
bas
e
,
forState
:
.
Normal
)
item1
.
setTitleColor
(
MaterialColor
.
yellow
.
bas
e
,
forState
:
.
Selected
)
let
item2
:
BottomNavigationBarItem
=
BottomNavigationBarItem
(
title
:
"
Music"
,
image
:
UIImage
(
named
:
"ic_music_note_white"
)?
.
imageWithRenderingMode
(
.
AlwaysOriginal
),
selectedImage
:
UIImage
(
named
:
"ic_music_note
_white"
))
item2
.
setTitleColor
(
MaterialColor
.
whit
e
,
forState
:
.
Normal
)
item2
.
setTitleColor
(
MaterialColor
.
whit
e
,
forState
:
.
Selected
)
let
item2
:
BottomNavigationBarItem
=
BottomNavigationBarItem
(
title
:
"
Photo"
,
image
:
UIImage
(
named
:
"ic_photo_camera_white"
)?
.
imageWithRenderingMode
(
.
AlwaysTemplate
),
selectedImage
:
UIImage
(
named
:
"ic_photo_camera
_white"
))
item2
.
setTitleColor
(
MaterialColor
.
grey
.
bas
e
,
forState
:
.
Normal
)
item2
.
setTitleColor
(
MaterialColor
.
yellow
.
bas
e
,
forState
:
.
Selected
)
let
item3
:
BottomNavigationBarItem
=
BottomNavigationBarItem
(
title
:
"
Music"
,
image
:
UIImage
(
named
:
"ic_music_note_white"
),
selectedImage
:
UIImage
(
named
:
"ic_music_note
_white"
))
item3
.
setTitleColor
(
MaterialColor
.
blue
.
lighten3
,
forState
:
.
Normal
)
item3
.
setTitleColor
(
MaterialColor
.
whit
e
,
forState
:
.
Selected
)
let
item3
:
BottomNavigationBarItem
=
BottomNavigationBarItem
(
title
:
"
Library"
,
image
:
UIImage
(
named
:
"ic_photo_library_white"
)?
.
imageWithRenderingMode
(
.
AlwaysTemplate
),
selectedImage
:
UIImage
(
named
:
"ic_photo_library
_white"
))
item3
.
setTitleColor
(
MaterialColor
.
grey
.
base
,
forState
:
.
Normal
)
item3
.
setTitleColor
(
MaterialColor
.
yellow
.
bas
e
,
forState
:
.
Selected
)
bottomNavigationBar
.
setItems
([
item1
,
item2
,
item3
],
animated
:
true
)
// bottomNavigationBar.tintColor = MaterialColor.whit
e
bottomNavigationBar
.
tintColor
=
MaterialColor
.
yellow
.
bas
e
}
}
Sources/BottomNavigationBar.swift
View file @
fd00b5e3
...
...
@@ -235,6 +235,11 @@ public class BottomNavigationBar : UITabBar {
if
let
v
:
UIView
=
superview
{
frame
=
CGRectMake
(
0
,
v
.
bounds
.
height
-
56
,
v
.
bounds
.
width
,
56
)
}
if
MaterialDevice
.
landscape
{
itemPositioning
=
.
Centered
}
else
{
itemPositioning
=
.
Fill
}
}
/**
...
...
Sources/BottomNavigationBarItem.swift
View file @
fd00b5e3
...
...
@@ -33,7 +33,7 @@ import UIKit
@IBDesignable
public
class
BottomNavigationBarItem
:
UITabBarItem
{
/// Sets the color of the title color for a state.
public
func
setTitleColor
(
color
:
UIColor
?,
forS
tate
:
UIControlState
)
{
setTitleTextAttributes
([
NSForegroundColorAttributeName
:
MaterialColor
.
white
],
forState
:
.
Normal
)
public
func
setTitleColor
(
color
:
UIColor
,
forState
s
tate
:
UIControlState
)
{
setTitleTextAttributes
([
NSForegroundColorAttributeName
:
color
],
forState
:
state
)
}
}
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