android – 如何使用Design Library实现折叠图像视图,如Google IO 2015 App

android – 如何使用Design Library实现折叠图像视图,如Google IO 2015 App,第1张

概述如何使用Design Library实现像Google IO 2015这样的折叠工具栏布局设计 在Google IO 2015的开源代码中,它未使用设计库(CoordinatorLayout,CollapsingToolbarLayout等)实现 注意:此处工具栏位于上部的底部.我需要工具栏滚动像这样附上textview或上部的任何其他视图. 最后我能够实现它. <?xml version="1. 如何使用Design library实现像Google IO 2015这样的折叠工具栏布局设计

在Google IO 2015的开源代码中,它未使用设计库(CoordinatorLayout,CollapsingToolbarLayout等)实现

注意:此处工具栏位于上部的底部.我需要工具栏滚动像这样附上textvIEw或上部的任何其他视图.

解决方法 最后我能够实现它.
<?xml version="1.0" enCoding="utf-8"?><androID.support.design.Widget.CoordinatorLayout 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:layout_wIDth="match_parent"    androID:layout_height="match_parent"    tools:context="com.vipul.myapplication.ScrollingActivity">    <androID.support.design.Widget.AppbarLayout        androID:ID="@+ID/app_bar"        androID:layout_wIDth="match_parent"        androID:layout_height="wrap_content"        app:elevation="6dp"        androID:theme="@style/Apptheme.AppbarOverlay">        <androID.support.design.Widget.CollapsingToolbarLayout            androID:ID="@+ID/toolbar_layout"            androID:layout_wIDth="match_parent"            androID:layout_height="match_parent"            app:contentScrim="?attr/colorPrimary"            app:layout_scrollFlags="scroll|enteralwaysCollapsed">            <ImageVIEw                androID:layout_wIDth="match_parent"                androID:layout_height="wrap_content"                androID:background="@drawable/placeholder"                androID:fitsSy@R_502_6563@windows="true"                androID:scaleType="centerCrop"                app:layout_collapseMode="parallax"/>        </androID.support.design.Widget.CollapsingToolbarLayout>        <FrameLayout            androID:layout_wIDth="match_parent"            androID:layout_height="wrap_content"            androID:clipChildren="false"            androID:clipTopadding="false">            <androID.support.v7.Widget.Toolbar                androID:layout_wIDth="match_parent"                androID:layout_height="?attr/actionbarSize"                androID:ID="@+ID/toolbar"                app:title=" "                app:popuptheme="@style/Apptheme.PopupOverlay"/>            <linearLayout                androID:layout_wIDth="match_parent"                androID:layout_height="wrap_content"                androID:layout_margintop="?attr/actionbarSize"                androID:layout_marginleft="60dp"                androID:layout_marginStart="60dp"                androID:layout_marginRight="16dp"                androID:paddingtop="8dp"                androID:paddingBottom="8dp"                androID:orIEntation="vertical">                <TextVIEw                    androID:layout_wIDth="match_parent"                    androID:layout_height="wrap_content"                    androID:text="@string/app_name"                    androID:textcolor="#FFF"                    androID:textSize="18sp" />                <TextVIEw                    androID:layout_wIDth="match_parent"                    androID:layout_height="wrap_content"                    androID:layout_margintop="5dp"                    androID:text="@string/app_name"                    androID:textcolor="#FFF"                    androID:textSize="16sp" />            </linearLayout>        </FrameLayout>    </androID.support.design.Widget.AppbarLayout>    <!--<include layout="@layout/content_scrolling" />-->    <androID.support.v4.Widget.nestedScrollVIEw 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:layout_wIDth="match_parent"        androID:layout_height="match_parent"        app:layout_behavior="@string/appbar_scrolling_vIEw_behavior">        <TextVIEw            androID:layout_wIDth="wrap_content"            androID:layout_height="wrap_content"            androID:layout_margin="@dimen/text_margin"            androID:text="@string/large_text" />    </androID.support.v4.Widget.nestedScrollVIEw></androID.support.design.Widget.CoordinatorLayout>

总结

以上是内存溢出为你收集整理的android – 如何使用Design Library实现折叠图像视图,如Google IO 2015 App全部内容,希望文章能够帮你解决android – 如何使用Design Library实现折叠图像视图,如Google IO 2015 App所遇到的程序开发问题。

如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。

欢迎分享,转载请注明来源:内存溢出

原文地址:https://54852.com/web/1136889.html

(0)
打赏 微信扫一扫微信扫一扫 支付宝扫一扫支付宝扫一扫
上一篇 2022-05-30
下一篇2022-05-30

发表评论

登录后才能评论

评论列表(0条)

    保存