扫码关注官方订阅号
我也不知道是不是叫这个名字,希望大神指点,就是下拉时出现上划时移动隐藏,好多app都有,谢谢
拥有18年软件开发和IT教学经验。曾任多家上市公司技术总监、架构师、项目经理、高级软件工程师等职务。 网络人气名人讲师,...
外层CoordinatorLayout 里层AppbarLayout 然后Toolbar
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" android:layout_width="match_parent" android:layout_height="match_parent" android:background="@color/primary"> <android.support.v4.widget.DrawerLayout android:layout_width="match_parent" android:layout_height="match_parent" android:id="@+id/drawer_layout"> <android.support.design.widget.CoordinatorLayout android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="vertical"> <android.support.v4.view.ViewPager android:id="@+id/pager" android:layout_width="match_parent" android:layout_height="match_parent" app:layout_behavior="@string/appbar_scrolling_view_behavior" /> <android.support.design.widget.AppBarLayout android:layout_width="match_parent" android:layout_height="wrap_content" android:theme="@style/AppTheme.AppBarOverlay" app:elevation="0dp"> <android.support.v7.widget.Toolbar android:id="@+id/toolbar" android:layout_width="match_parent" android:layout_height="?attr/actionBarSize" android:background="?attr/colorPrimary" android:minHeight="?attr/actionBarSize" app:layout_scrollFlags="scroll|enterAlways" /> <android.support.design.widget.TabLayout android:id="@+id/layout_tab" android:layout_width="match_parent" android:layout_height="wrap_content" app:tabIndicatorColor="#33000000" app:tabIndicatorHeight="4dp" app:tabPaddingBottom="0dp" app:tabPaddingEnd="0dp" app:tabPaddingStart="0dp" app:tabPaddingTop="0dp" app:tabSelectedTextColor="#fff" app:tabGravity="fill" app:tabTextColor="#fff" /> </android.support.design.widget.AppBarLayout> </android.support.design.widget.CoordinatorLayout> <fragment android:name="com.segmentfault.app.fragment.MineFragment" android:layout_width="match_parent" android:layout_height="match_parent" android:layout_gravity="start" /> </android.support.v4.widget.DrawerLayout> <fragment android:layout_width="match_parent" android:layout_height="match_parent" android:name="com.segmentfault.app.fragment.SplashFragment" android:id="@+id/splash_fragment" /> </FrameLayout>
(没有比贴SegmentFault for Android源码更有诚意的了吧?
SegmentFault for Android
v7的toolbar
外层用 CoordinatorLayout,内部嵌套 Toolbar。
具体可以参考这篇博客:http://blog.csdn.net/u010687392/article/details/46852565
http://www.jianshu.com/p/1078568e859f?utm_source=jianliao.com
微信扫码关注PHP中文网服务号
QQ扫码加入技术交流群
扫描下载App
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号
PHP学习
技术支持
返回顶部
外层CoordinatorLayout 里层AppbarLayout 然后Toolbar
(没有比贴
SegmentFault for Android
源码更有诚意的了吧?v7的toolbar
外层用 CoordinatorLayout,内部嵌套 Toolbar。
具体可以参考这篇博客:http://blog.csdn.net/u010687392/article/details/46852565
http://www.jianshu.com/p/1078568e859f?utm_source=jianliao.com