滑动以添加叠加视图?

时间:2013-11-07 04:35:08

标签: android android-layout android-fragments swipe

我想添加一个顶部覆盖视图,并向下滑动,并添加一个底部覆盖视图,并向上滑动。使用FragmentActivity。

如何显示叠加视图?

________________________                  _______________________
|                      |                  |                      |
|                      |                  |   Overlay View       |
|                      |                  |   (Transparent bkg)  | 
|                      |                  |______________________|
|  (Swipe to bottom)   |      ===== >     |                      |
|                      |                  |                      |
|                      |                  |                      |
|                      |                  |                      |
|       Main View      |                  |    Main View         |
|                      |                  |                      |
|                      |                  |                      |
________________________                  ________________________

1 个答案:

答案 0 :(得分:0)

您可以使用Android中的展示库使用手形图标滑动

ShowcaseView sv;
ViewTarget target = new ViewTarget(R.id.yourviewid, this);
sv = ShowcaseView.insertShowcaseView(target, this, R.string.showcase_main_title, R.string.showcase_main_message, co);

从上到下滑动

sv.animateGesture(0, 0, 0, -400);

和从下到上滑动

sv.animateGesture(0, 0, 0, 400);