相关Demo
| 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 |
|---|---|
![]() |
![]() |
使用方式举例
struct ForegroundView: View {
var body: some View {
WRNavigationBar {
ListView()
}
.title("set foreground")
.foreground(.white)
.isBackButtonBlack(false)
.background(Color.blue)
}
}
复制代码
相关方法
| api | description |
|---|---|
| foreground(_ foreground: Color) | foreground |
| title(_ title: String) | 标题(titleView is default) |
| hiddenLine(_ hidden: Bool) | 隐藏底部线 |
| backButtonImageName(_ named: String) | 返回按钮图片资源名称 |
| backButtonHidden(_ hidden: Bool) | 隐藏返回按钮 |
| isBackButtonBlack(_ isBlack: Bool) | 黑色返回按钮(backButton is default) |
| ignoringTopArea(_ ignore: Bool) | 内容忽略导航栏顶部区域 |
| maxWidth(leading: CGFloat = 80, trailing: CGFloat = 80) | leadingView 和 trailingView 最大宽度 |
| background(_ background: Background) | background(任意视图) |
| backButtonTapAction(_ tapAction: @escaping WRBlock) | 拦截返回按钮事件( hasBackButton == true) |
| debug(_ debug: Bool) | debug(开启调试) |
| navigationBarTitleView<Content: View>(@ViewBuilder titleView: () -> Content) | titleView(任意视图) |
| wrNavigationBarItems<Leading: View, Trailing: View>(leading:xx, trailing:xx) | 导航栏 leading & trailing 视图 |
| wrNavigationBarItems<Content: View>(@ViewBuilder leading: () -> Content) | 导航栏 leading 视图 |
| wrNavigationBarItems(trailing: () -> Content) | 导航栏 trailing 视图 |
详情地址
© 版权声明
文章版权归作者所有,未经允许请勿转载。
THE END

































![[桜井宁宁]COS和泉纱雾超可爱写真福利集-一一网](https://www.proyy.com/skycj/data/images/2020-12-13/4d3cf227a85d7e79f5d6b4efb6bde3e8.jpg)

![[桜井宁宁] 爆乳奶牛少女cos写真-一一网](https://www.proyy.com/skycj/data/images/2020-12-13/d40483e126fcf567894e89c65eaca655.jpg)