snpmyn

Results 19 comments of snpmyn

> > 设置状态栏哪种模式会发生这种情况,渐变,透明,还是纯色 > > 沉浸式 切换会导致布局上移。必须设置高才可以避免

> 这是因为activity设置了全屏模式,内部的fragment会整体上移,如果顶部view的高度设置了wrap_content,高度也会被变成负数,所以导致setPaddingTop方法没有被执行 Activity没有设置全屏模式。但问题确如你描述的一样,获取到的是负数。

> demo中的第一个fragment设置了全屏,操作的是activity 那这样的话,Fragment场景该如何解决?有办法吗?因为Fragment场景的话,需要设置Activity隐藏标题栏

> 第二种方法,toolbar高度不限制,在toolbar上方设置一个view在最顶部 > > ``` > android:layout_width="match_parent" > android:layout_height="0dp" > android:background="@color/colorPrimary"/> > ..... > ``` 这个布局放在Activity中可以吗?还有就是用到AppbarLayout时如何适配?烦请告知,谢谢~~~

> ``` > 第一种方法 > android:layout_width="match_parent" > android:layout_height="wrap_content" > android:theme="@style/AppTheme.AppBarOverlay" > app:elevation="@dimen/dp0"> > > android:id="@+id/toolbar" > android:layout_width="match_parent" > android:layout_height="?attr/actionBarSize" > android:background="?attr/colorPrimary" > app:popupTheme="@style/ToolbarPopupTheme" > app:titleTextAppearance="@style/Toolbar.TitleText"> > > > ``` >...

> > ``` > > 第一种方法 > > > android:layout_width="match_parent" > > android:layout_height="wrap_content" > > android:theme="@style/AppTheme.AppBarOverlay" > > app:elevation="@dimen/dp0"> > > > > > android:id="@+id/toolbar" > > android:layout_width="match_parent" > >...

> > > ``` > > > 第一种方法 > > > > > android:layout_width="match_parent" > > > android:layout_height="wrap_content" > > > android:theme="@style/AppTheme.AppBarOverlay" > > > app:elevation="@dimen/dp0"> > > > >...

> Demo已更新,已更新fragment界面的代码实现,可以pull下来看看 好的大佬!

> hello, did you find a solution for this? i'm facing the same issue here sorry, no