Comments (13)
immersive()的第一个参数是状态栏颜色, 如果是view则会提取其背景颜色. 第二个参数是状态栏文字颜色
我不清楚你的toolbar的背景颜色是什么?
immersive(Color.TRANSPARENT, true) // 设置状态栏颜色为透明, 文字颜色为黑色
toolbar.statusPadding() // 状态栏设置一个paddingTop为状态栏高度, 避免和状态栏重叠
from statusbar.
immersive()的第一个参数是状态栏颜色, 如果是view则会提取其背景颜色. 第二个参数是状态栏文字颜色
我不清楚你的toolbar的背景颜色是什么?
immersive(Color.TRANSPARENT, true) // 设置状态栏颜色为透明, 文字颜色为黑色 toolbar.statusPadding() // 状态栏设置一个paddingTop为状态栏高度, 避免和状态栏重叠
啊,我是用setSupportActionBar(toolBar)来设置toolbar的,背景色应该就是主题里的主要颜色,刚才用你的这两行代码设置后和我原来的效果基本一致了,就是statusPadding边距有点大了😂滚动自动显示toolbar时状态栏和toolbar会重叠, 我是直接把顶部边距和内边距写死的😢
app:layout_scrollFlags="scroll|enterAlways|snap"
android:layout_marginTop="5dp"
android:paddingTop="5dp"
from statusbar.
总体来说老哥你的这个库是没啥问题的,不设置自动滚动显示隐藏toolbar的话,重叠一点也没啥问题,反正能滚动到完全显示toolbar,像我这样要在主题里设置状态栏颜色透明还有窗口状态栏日间模式,在activity里得设置窗口扩展到屏幕外,还得给toolbar设置顶部和内边距😂
from statusbar.
"滚动自动显示toolbar时状态栏和toolbar会重叠", 这就是透明状态栏正常情况. 如果你不想就直接设置状态栏为指定颜色(非透明)
from statusbar.
"滚动自动显示toolbar时状态栏和toolbar会重叠", 这就是透明状态栏正常情况. 如果你不想就直接设置状态栏为指定颜色(非透明)
啊,我的意思是滚动自动显示toolbar时候状态栏会紧挨着toolbar有一点遮挡,然后还能继续拉一点,让状态栏跟toolbar隔开距离,就是那个边距的问题了,我是给写死了margintop属性,让状态栏和toolbar有一点距离
from statusbar.
不太清楚你的描述, 你录个视频我看下什么错误
from statusbar.
不太清楚你的描述, 你录个视频我看下什么错误
WeChat_20220106123548.mp4
from statusbar.
这不是很正常吗?
你的需求是用户在滑动过程中手势停止时候不被状态栏遮挡吧, 你应该给CoordinatorLayout下面的组件设置snap属性
from statusbar.
这不是很正常吗?
你的需求是用户在滑动过程中手势停止时候不被状态栏遮挡吧, 你应该给CoordinatorLayout下面的组件设置snap属性
我就是觉得滚动到toolbar显示时,状态栏跟toolbar离得太近了,而且滚动到自动显示后还能再往上拉一点,感觉不大舒服😂
from statusbar.
这不是很正常吗?
你的需求是用户在滑动过程中手势停止时候不被状态栏遮挡吧, 你应该给CoordinatorLayout下面的组件设置snap属性
还有刚滚动到显示toolbar时,右边的菜单按钮弹出菜单框会遮挡住状态栏(还有老哥,github我是真的连不上了,梯子都挂了,回复都得刷新半天😂)
from statusbar.
这种用户主动滑动到一半被遮挡是正常情况. 透明状态栏都这样. 不然你觉得既不能遮挡又要透明那怎么显示
你设置snap属性才是解决方案
from statusbar.
这种用户主动滑动到一半被遮挡是正常情况. 透明状态栏都这样. 不然你觉得既不能遮挡又要透明那怎么显示 你设置snap属性才是解决方案
啊,是这样,我一开始也设置了snap属性
app:layout_scrollFlags="scroll|enterAlways|snap"
就是断在中间会剩一些边距😂
这样也挺好的了,麻烦老哥了😉
from statusbar.
有问题再讨论
from statusbar.
Related Issues (5)
- 在Fragment中如何使用 HOT 1
- 有没有虚拟按键相关的 HOT 1
- 功能有点简陋,在fragment和dialog中无法使用 HOT 3
- viewpage2+fragment 状态栏颜色为透明失效
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from statusbar.