有人能向我指出一个例子,或一个库用于幻灯片向上窗口。我有一个应用程序和一个动作,我想滑动一个窗口从屏幕底部显示信息给用户。
我只想让窗户往上滑一点点以显示信息。对用户来说有点像hnt,可能是屏幕上的1/4。
这个窗口可以手动关闭,也可以使用计时器。我希望用xamarin来实现这一点,但是一个java示例也会有所帮助。
发布于 2014-03-26 13:37:13
您可能必须更改此方法中的一些变量。我在我的应用程序中使用了这个。从下到上动画一个relativeLayout
private void animate(){
RelativeLayout rl = (RelativeLayout)findViewById(R.id.yourLayout);
AnimationSet set = new AnimationSet(true);
Animation animation = new TranslateAnimation(
Animation.RELATIVE_TO_SELF, 0.0f, Animation.RELATIVE_TO_SELF, 0.0f,
Animation.RELATIVE_TO_SELF, 0.85f, Animation.RELATIVE_TO_SELF, 0.0f
);
animation.setDuration(250);
set.addAnimation(animation);
LayoutAnimationController controller = new LayoutAnimationController(set, 0.25f);
rl.setLayoutAnimation(controller);
}https://stackoverflow.com/questions/22662342
复制相似问题