Android 线性布局动画
您好,我有一个线性布局,我将其用作列表视图中的底部栏,当按下拉链时,我会显示布局并在其他时候隐藏它。我认为将其向上滑动会更好,因此我编写了以下内容和一个动画 xml,一切都运行良好。然而,当它滑入时,它会显示布局滑入的黑色背景。我如何更改该背景以显示为透明,以便列表视图显示并且布局在列表视图上滑动而不是黑色背景。
LinearLayout mainLayout=(LinearLayout)this.findViewById(R.id.bottombar);
Animation slideUp = AnimationUtils.loadAnimation(this, R.anim.slide_up_in);
mainLayout.startAnimation(slideUp);
mainLayout.setVisibility(LinearLayout.VISIBLE);
感谢您的帮助
===编辑===
发生情况的屏幕截图
这是选择 zip 之前的列表视图
这是幻灯片之前的内容(白色背景现在将活动主题更改为浅色)
这就是幻灯片中间部分(抱歉吐司)
Hi i have a linear layout which i'm using as a bottom bar in a listview and when zips are pressed i show the layout and hide it at other times. I decided it would look nicer to slide it up so i wrote the following and an animation xml which all works well. However when it slides in it shows a black background where the layout is sliding into. How can i change that background to show as transparent so the listview shows and the layout slides over the listview rather than a black background.
LinearLayout mainLayout=(LinearLayout)this.findViewById(R.id.bottombar);
Animation slideUp = AnimationUtils.loadAnimation(this, R.anim.slide_up_in);
mainLayout.startAnimation(slideUp);
mainLayout.setVisibility(LinearLayout.VISIBLE);
Thanks for any help
===Edit===
Screen shots of what's happening
This is the list view before a zip is selected
This is it right before the slide (white background now changed the activity theme to light)
And this is it mid slide (sorry about the toast)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论