-
Notifications
You must be signed in to change notification settings - Fork 89
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
2cab50f
commit b9914a3
Showing
1 changed file
with
19 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,52 +1,56 @@ | ||
# ETNavBarTransparent | ||
Change NavigationBar's transparency at pop gestrue and other situation | ||
###Screenshots | ||
|
||
## Animation | ||
![image](https://github.com/EnderTan/ETNavBarTransparentDemo/blob/master/navDemo.gif) | ||
|
||
##Installation | ||
## Installation | ||
Add the following line to your Podfile: | ||
``` | ||
```ruby | ||
pod 'ETNavBarTransparent' | ||
``` | ||
|
||
Then, run the following command: | ||
``` | ||
```bash | ||
$ pod install | ||
``` | ||
|
||
Or,Simply drag "ET_NavBarTransparent.swift" to your project | ||
Or, simply drag `ET_NavBarTransparent.swift` to your project. | ||
|
||
## Usage | ||
|
||
##Usage | ||
Change NavigationBar's transparency and tintColor where you want: | ||
``` | ||
//Example: | ||
//Change in viewDidLoad | ||
|
||
```swift | ||
// Example: | ||
// Change in viewDidLoad | ||
override func viewDidLoad() { | ||
super.viewDidLoad() | ||
|
||
self.navBarBgAlpha = 0 | ||
self.navBarTintColor = .white | ||
} | ||
|
||
//Change in scrollView scroll | ||
// Change in scrollView scroll | ||
func scrollViewDidScroll(_ scrollView: UIScrollView) { | ||
|
||
if scrollView.contentOffset.y > 100 { | ||
navBarBgAlpha = 1 | ||
navBarTintColor = UIColor.defaultNavBarTintColor() | ||
}else{ | ||
} else { | ||
navBarBgAlpha = 0 | ||
navBarTintColor = UIColor.white | ||
navBarTintColor = .white | ||
} | ||
|
||
} | ||
``` | ||
|
||
|
||
##Related articles | ||
## Related articles | ||
[导航栏的平滑显示和隐藏 - 个人页的自我修养(1)](http://www.jianshu.com/p/454b06590cf1) | ||
|
||
##License | ||
## License | ||
MIT license. See LICENSE for details. | ||
|
||
##Contact | ||
## Contact | ||
Follow and contact me on Weibo [@日光镇](http://weibo.com/endertan) or [My Blog](http://www.jianshu.com/u/a958e552973b) |