-
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.
Merge pull request #10 from danshevluk/readme-fix
Codestyle and Readme fix
- Loading branch information
Showing
2 changed files
with
89 additions
and
92 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
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,55 @@ | ||
# 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 | ||
override func viewDidLoad() { | ||
super.viewDidLoad() | ||
self.navBarBgAlpha = 0 | ||
self.navBarTintColor = .white | ||
} | ||
//Change in scrollView scroll | ||
func scrollViewDidScroll(_ scrollView: UIScrollView) { | ||
if scrollView.contentOffset.y > 100 { | ||
navBarBgAlpha = 1 | ||
navBarTintColor = UIColor.defaultNavBarTintColor() | ||
}else{ | ||
navBarBgAlpha = 0 | ||
navBarTintColor = UIColor.white | ||
} | ||
|
||
```swift | ||
// Example: | ||
// Change in viewDidLoad | ||
override func viewDidLoad() { | ||
super.viewDidLoad() | ||
|
||
self.navBarBgAlpha = 0 | ||
self.navBarTintColor = .white | ||
} | ||
|
||
// Change in scrollView scroll | ||
func scrollViewDidScroll(_ scrollView: UIScrollView) { | ||
|
||
if scrollView.contentOffset.y > 100 { | ||
navBarBgAlpha = 1 | ||
navBarTintColor = UIColor.defaultNavBarTintColor() | ||
} else { | ||
navBarBgAlpha = 0 | ||
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) |