Android的向上滑动查看 [英] Android Sliding Up View

查看:213
本文介绍了Android的向上滑动查看的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要做一个向上滑动查看至极应该向上滑动从屏幕的底部,当我点击一个按钮。它显示在屏幕的底部,我需要滑动/将其拖动到屏幕的中心。下面的图片说明它更好。 几乎像AndroidSlidingUpPanel从umano,你可以找到这里

I need to do a Sliding Up View wich should slide up from the bottom of the screen when I click a button. It has to show on the bottom of the screen and I need to slide/drag it to the center of the screen. The images below explain it better. almost like the AndroidSlidingUpPanel from "umano" which you can find here:

现在的问题是,我想第一个孩子(我查看的内容 - 例如图像),以填补所有的屏幕,也是我想要的第二个孩子(实际的底栏)将显示,当我点击一个按钮。下面的图片说明它更好。如果没有可能通过改变AndroidSlidingUpPanel要做到这一点,我该怎么办呢?我从来没有与意见是这样的。我真的AP preciate任何提示或帮助。非常感谢你。

The problem is that I want the first child (The content of my View - an image for example) to fill all the screen and also I want the second child(the actual bottom bar) to be showed when I click a button. The images below explain it better. If there is not possible to do this by changing the AndroidSlidingUpPanel, how can I do that? I have never worked with views like this. I would really appreciate any tip or help. Thank you very much.

推荐答案

要隐藏或显示面板,你可以使用

To hide or show panel, you can use

showPanel()

showPanel()

方法。

要隐藏试试这个:

SlidingUpPanelLayout slidingPanel =(SlidingUpPanelLayout)findViewById(R.id.sliding_panel);           slidingPanel.hidePanel();

SlidingUpPanelLayout slidingPanel = (SlidingUpPanelLayout) findViewById(R.id.sliding_panel); slidingPanel.hidePanel();

要使它APPE

SlidingUpPanelLayout slidingPanel =(SlidingUpPanelLayout)findViewById(R.id.sliding_panel);           slidingPanel.showPanel();

SlidingUpPanelLayout slidingPanel = (SlidingUpPanelLayout) findViewById(R.id.sliding_panel); slidingPanel.showPanel();

这是仅在v中AndroidSlidingUpPanel 2.0( https://github.com/umano/AndroidSlidingUpPanel)。据我所知,它包含在Android的支持库V13了,但不知道是否有最新的版本。

This is available only in v 2.0 of AndroidSlidingUpPanel (https://github.com/umano/AndroidSlidingUpPanel). As I know, it's included in android support library v13 now, but not sure if there is latest version.

这篇关于Android的向上滑动查看的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆