如何在Android中没有工具栏的情况下在片段中对布局进行视差滚动

如何在Android中没有工具栏的情况下在片段中对布局进行视差滚动,第1张

概述我在我的 Android应用程序中使用片段. 这个Fragment没有自己的Toolbar或android.support.v7.widget.Toolbar元素,而是使用它的父活动中的getSupportActionBar().现在,我想通过infoRL设置ScrollView的ScrollView滚动. 我在线检查了一些资源,但大多数都是关于Parallax的ScrollView而不是Imag 我在我的 Android应用程序中使用片段.
这个Fragment没有自己的Toolbar或androID.support.v7.Widget.Toolbar元素,而是使用它的父活动中的getSupportActionbar().现在,我想通过infoRL设置ScrollVIEw的ScrollVIEw滚动.

我在线检查了一些资源,但大多数都是关于Parallax的ScrollVIEw而不是ImageVIEw,或者在布局中使用工具栏.

所以我想知道如何构建它们.

以下是我的layout.xml文件的结构.

<relativeLayout xmlns:androID="http://schemas.androID.com/apk/res/androID"    xmlns:app="http://schemas.androID.com/apk/res-auto"    androID:orIEntation="vertical"    androID:layout_wIDth="match_parent"    androID:layout_height="match_parent"><include    layout="@layout/custom_toolbar"/><linearLayout    androID:ID="@+ID/infoRL"    androID:orIEntation="vertical"    androID:paddingtop="40dp"    androID:layout_wIDth="match_parent"    androID:paddingBottom="40dp"    androID:layout_height="wrap_content"    androID:background="@color/treasur_yellow"    androID:layout_below="@+ID/custom_toolbar_element">    <com.joooonho.SelectableRoundedImageVIEw        androID:ID="@+ID/profileImageVIEw"        androID:layout_wIDth="128dp"        androID:layout_gravity="center_horizontal"        androID:layout_height="128dp"        androID:layout_centerHorizontal="true"        androID:adjustVIEwBounds="true"        androID:scaleType="centerCrop"        app:sriv_left_bottom_corner_radius="0dp"        app:sriv_oval="true"        app:sriv_right_bottom_corner_radius="0dp" />    <hunt.ayush.com.traserhunt.utility.CentuaryGothicTextVIEw        androID:ID="@+ID/username"        androID:layout_gravity="center_horizontal"        androID:layout_wIDth="wrap_content"        androID:layout_height="wrap_content"        androID:layout_below="@+ID/imageborderLayout"        androID:layout_centerHorizontal="true"        androID:layout_margintop="15dp"        androID:text="Fetching name"        androID:textcolor="@color/treasure_black"        androID:textSize="20sp" />    </linearLayout>    <ScrollVIEw /></relativeLayout>
解决方法@H_502_22@
Please try with frame layout once<FrameLayout xmlns:androID="http://schemas.androID.com/apk/res/androID"androID:layout_wIDth="match_parent"androID:layout_height="match_parent"><ImageVIEw    androID:ID="@+ID/heroImageVIEw"    androID:layout_wIDth="match_parent"    androID:layout_height="250dp"    androID:background="@drawable/wallpaper"    androID:scaleType="fitCenter" /><ListVIEw    androID:ID="@+ID/ListVIEw"    androID:layout_wIDth="match_parent"    androID:layout_height="wrap_content"    androID:divIDer="#9E9E9E"    androID:divIDerHeight="1dp"    androID:scrollbars="none"></ListVIEw><TextVIEw    androID:ID="@+ID/stickyVIEw"    androID:layout_wIDth="match_parent"    androID:layout_height="50dp"    androID:background="#222"    androID:gravity="center_vertical"    androID:paddingleft="10dp"    androID:text="heading1"    androID:textcolor="#fff"    androID:textSize="20sp"    androID:textStyle="bold" />
总结

以上是内存溢出为你收集整理的如何在Android中没有工具栏的情况下在片段中对布局进行视差滚动全部内容,希望文章能够帮你解决如何在Android中没有工具栏的情况下在片段中对布局进行视差滚动所遇到的程序开发问题。

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

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

原文地址: http://outofmemory.cn/web/1125924.html

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

发表评论

登录后才能评论

评论列表(0条)

保存