将AndroidSlidingUpPanel定位到特定高度 [英] Positioning AndroidSlidingUpPanel to a specific height
本文介绍了将AndroidSlidingUpPanel定位到特定高度的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在探索 https://github.com/umano/AndroidSlidingUpPanel 库。当我滑动底部面板时,在滑动完成时它将获得完整的屏幕区域。
I am exploring https://github.com/umano/AndroidSlidingUpPanel library. When I slide the bottom panel, on slide complete it acquires complete screen area.
任何人都可以帮助我,如何将底部面板停在一定高度,例如将其滑动到屏幕中间?
Can anyone help me, How to stop the bottom panel to a certain height, for e.g. slide it till middle of screen??
推荐答案
您是否考虑过使用 setAnchorPoint(float)?
来自SlidingUpPanelDemo项目中的DemoActivity
From the DemoActivity in the SlidingUpPanelDemo project
SlidingUpPanelLayout layout = (SlidingUpPanelLayout) findViewById(R.id.sliding_layout);
layout.setAnchorPoint(0.3f);
这将使面板滑动到屏幕高度的30%。
this will make the panel slide to 30% of the screen height.
这篇关于将AndroidSlidingUpPanel定位到特定高度的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文