android-从布局背面对listview进行动画处理

android-从布局背面对listview进行动画处理,第1张

概述我正在制作动画,我有一个布局和列表视图,并且我将动画从左到右应用到列表视图,其工作正常,但列表视图的幻灯片位于布局的前面,我想从布局的后面做.单击布局时,列表视图将从左向右滑动,并保持布局旁边的位置,如下图所示.谢谢.解决方法:尝试理解视图顺序(层次结构)让我用一个例子

我正在制作动画,我有一个布局和列表视图,并且我将动画从左到右应用到列表视图,其工作正常,但列表视图的幻灯片位于布局的前面,我想从布局的后面做.

单击布局时,列表视图将从左向右滑动,并保持布局旁边的位置,如下图所示.

谢谢.

解决方法:

尝试理解视图顺序(层次结构)
让我用一个例子来阐明

<?xml version="1.0" enCoding="utf-8"?> <relativeLayout xmlns:androID="http://schemas.androID.com/apk/res/androID" androID:layout_wIDth="match_parent" androID:layout_height="match_parent" > <TextVIEw androID:ID="@+ID/tvMessage" androID:layout_wIDth="wrap_content" androID:layout_height="wrap_content" androID:text="dasdjfiuihuhds" /> <button androID:ID="@+ID/btnOk" androID:layout_wIDth="wrap_content" androID:layout_height="wrap_content" androID:text="Ok" /> </relativeLayout>

这将使TextvIEw超过buttonVIEw

<?xml version="1.0" enCoding="utf-8"?> <relativeLayout xmlns:androID="http://schemas.androID.com/apk/res/androID" androID:layout_wIDth="match_parent" androID:layout_height="match_parent" > <button androID:ID="@+ID/btnOk" androID:layout_wIDth="wrap_content" androID:layout_height="wrap_content" androID:text="Ok" /> <TextVIEw androID:ID="@+ID/tvMessage" androID:layout_wIDth="wrap_content" androID:layout_height="wrap_content" androID:text="dasdjfiuihuhds" /> </relativeLayout>

这将使button超过TextVIEw

第一种情况代码

<relativeLayout > <TextVIEw> <button>

第二种案例代码

<relativeLayout > <button> <TextVIEw>

简而言之,您可以通过遵循代码层次结构来维护顺序

总结

以上是内存溢出为你收集整理的android-从布局背面对listview进行动画处理全部内容,希望文章能够帮你解决android-从布局背面对listview进行动画处理所遇到的程序开发问题。

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

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

原文地址: https://outofmemory.cn/web/1072540.html

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

发表评论

登录后才能评论

评论列表(0条)

保存