本文实例为大家分享了Android实现顶部悬浮效果的具体代码,供大家参考,具体内容如下效果图 布局<?xml version="1.0" encoding="utf-8"?><android.su
本文实例为大家分享了Android实现顶部悬浮效果的具体代码,供大家参考,具体内容如下
效果图
布局
<?xml version="1.0" encoding="utf-8"?><android.support.v4.widget.SwipeRefreshLayout xmlns:android="Http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:tools="http://schemas.android.com/tools" android:id="@+id/swipeRefreshLayout" android:layout_width="match_parent" android:layout_height="match_parent" tools:context=".ui.activity.NewPersonalCardActivity"> <android.support.design.widget.CoordinatorLayout android:id="@+id/rootLayout" android:layout_width="match_parent" android:layout_height="match_parent"> <android.support.design.widget.AppBarLayout android:id="@+id/appBarLayout" android:layout_width="match_parent" android:layout_height="wrap_content"> <android.support.design.widget.CollapsingToolbarLayout android:id="@+id/collapsingToolbarLayout" android:layout_width="match_parent" android:layout_height="192dp" app:layout_scrollFlags="scroll|exitUntilCollapsed" app:titleEnabled="false"> <LinearLayout android:id="@+id/headLayout" android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="vertical" app:layout_collapseMode="pin" app:layout_collapseParallaxMultiplier="0.7"> <include layout="@layout/personal_new_top" /> </LinearLayout> <android.support.v7.widget.Toolbar android:id="@+id/toolBar" android:layout_width="match_parent" android:layout_height="44dp" android:background="@color/white" android:navigationIcon="@drawable/icon_back" app:contentInsetLeft="0dp" app:contentInsetStart="0dp" app:layout_collapseMode="pin" app:navigationIcon="@drawable/icon_back"> <TextView android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_gravity="center" android:singleLine="true" android:textColor="@color/c333333" android:textSize="16sp" tools:text="讲师" /> </android.support.v7.widget.Toolbar> </android.support.design.widget.CollapsingToolbarLayout> <include layout="@layout/new_personal_tabs" /> </android.support.design.widget.AppBarLayout> <android.support.v4.widget.NestedScrollView android:id="@+id/nestedScrollView" android:layout_width="match_parent" android:layout_height="match_parent" android:fillViewport="true" android:scrollbars="none" app:layout_behavior="@string/appbar_scrolling_view_behavior"> <android.support.v4.view.ViewPager android:id="@+id/viewPager" android:layout_width="match_parent" android:layout_height="match_parent" app:layout_behavior="@string/appbar_scrolling_view_behavior" /> </android.support.v4.widget.NestedScrollView> </android.support.design.widget.CoordinatorLayout></android.support.v4.widget.SwipeRefreshLayout>
--结束END--
本文标题: Android实现顶部悬浮效果
本文链接: https://lsjlt.com/news/220777.html(转载时请注明来源链接)
有问题或投稿请发送至: 邮箱/279061341@qq.com QQ/279061341
2024-05-24
2024-05-24
2024-05-24
2024-05-24
2024-05-24
2024-05-24
2024-05-24
2024-05-24
2024-05-24
2024-05-24
回答
回答
回答
回答
回答
回答
回答
回答
回答
回答
0