# SwiftUI-WRNavigationBar **Repository Path**: ma-zhida/SwiftUI-WRNavigationBar ## Basic Information - **Project Name**: SwiftUI-WRNavigationBar - **Description**: No description available - **Primary Language**: Unknown - **License**: MIT - **Default Branch**: main - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2021-07-21 - **Last Updated**: 2021-07-21 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # SwiftUI 技术交流 我创建了一个 SwiftUI 技术交流群,欢迎小伙伴们加入一起交流学习~ 可以加我微信我拉你进去(备注swiftui),我的微信号 wr1204607318 # SwiftUI-WRNavigationBar custom navigationBar in swiftui ## Requirements iOS 14.0 ## Installation pod 'SwiftUI-WRNavigationBar', '~>1.1.1' ## Overview |debug|custom title view|custom title view search| |:-:|:-:|:-:| |||| |leadingView&trailingView|foreground|hidden bottom line| |:-:|:-:|:-:| |||| |background image|background linearGradient|update background alpha| |:-:|:-:|:-:| |||| |intercept back event|ignore top area| |:-:|:-:| ||| ### Example
struct ForegroundView: View {
var body: some View {
WRNavigationBar {
ListView()
}
.title("set foreground")
.foreground(.white)
.isBackButtonBlack(false)
.background(Color.blue)
}
}
### Api
|api|description|
|------|-------|
| foreground(_ foreground: Color) | foreground |
| title(_ title: String) | title (titleView is default) |
| hiddenLine(_ hidden: Bool) | Is the line at the bottom of the navigationBar hidden |
| backButtonImageName(_ named: String) | Set backButton image name |
| backButtonHidden(_ hidden: Bool) | Is the backButton hidden |
| isBackButtonBlack(_ isBlack: Bool) | Is the backButton black style |
| ignoringTopArea(_ ignore: Bool) | Is the content align with the top of the navigationBar |
| maxWidth(leading: CGFloat = 80, trailing: CGFloat = 80) | Max width of leadingView and max width of trailingView |
| background