广告
返回顶部
首页 > 资讯 > 精选 >Android实现顶部悬浮效果
  • 302
分享到

Android实现顶部悬浮效果

android顶部悬浮roi 2023-05-30 20:05:03 302人浏览 八月长安
摘要

本文实例为大家分享了Android实现顶部悬浮效果的具体代码,供大家参考,具体内容如下效果图 布局<?xml version="1.0" encoding="utf-8"?><android.su

本文实例为大家分享了Android实现顶部悬浮效果的具体代码,供大家参考,具体内容如下

效果图

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://www.lsjlt.com/news/220777.html(转载时请注明来源链接)

有问题或投稿请发送至: 邮箱/279061341@qq.com    QQ/279061341

本篇文章演示代码以及资料文档资料下载

下载Word文档到电脑,方便收藏和打印~

下载Word文档
猜你喜欢
软考高级职称资格查询
编程网,编程工程师的家园,是目前国内优秀的开源技术社区之一,形成了由开源软件库、代码分享、资讯、协作翻译、讨论区和博客等几大频道内容,为IT开发者提供了一个发现、使用、并交流开源技术的平台。
  • 官方手机版

  • 微信公众号

  • 商务合作