SetResBoxState(true,true)页面弹出动画,类似抽屉效果

/**
     * 设置装饰列表框状态
     * 
     * @param isOpen
     *            是否打开
     * @param hasAnimation
     *            打开动画
     */
    private void SetResBoxState(boolean isOpen, boolean hasAnimation)
 {
        page.clearAnimation();

        int start;
        int end;
        if (isOpen) {
            page.setVisibility(View.VISIBLE);

            start = 1;
            end = 0;
        } else {
            page.setVisibility(View.GONE);

            start = 0;
            end = 1;
        }

        if (hasAnimation) {
            AnimationSet as;
            TranslateAnimation ta;
            as = new AnimationSet(true);
            ta = new TranslateAnimation(Animation.RELATIVE_TO_SELF, 0,

            Animation.RELATIVE_TO_SELF, 0, Animation.RELATIVE_TO_SELF, start,
                    Animation.RELATIVE_TO_SELF, end);
            ta.setDuration(350);
            as.addAnimation(ta);
            page.startAnimation(as);
        }
    }
时间: 2024-07-30 20:41:40

SetResBoxState(true,true)页面弹出动画,类似抽屉效果的相关文章

ios页面弹出方式《笔记》

1.presentViewController 方式,动画效果是从底部弹出,主要用在除导航类页面的弹出 let anotherVC = UIStoryboard(name: "Main", bundle: nil).instantiateViewControllerWithIdentifier("aaa") as! AnotherViewController presentViewController(anotherVC, animated: true, compl

IOS项目之弹出动画三

前面写了弹出动画两个,今天做商城时又用到了,看着这个用着蛮普遍的,所以记了下来 // // mallMoreView.h // XQB // // Created by City--Online on 15/7/6. // // #import <UIKit/UIKit.h> typedef void (^SelectMallMoreMenu)(NSInteger index); @interface mallMoreView : UIView //单例 + (mallMoreView *)s

IOS项目之弹出动画二

在IOS项目之弹出动画一中只是实现也功能,并没有体现面向对象的思想 ,今天就试着把它封装了一下,弹出视图的内容可以根据自定义,此处只是用UIDatePicker来演示 我把它传到了GitHub上   https://github.com/ywcui/YvanDatePicker.git 一.新建一个类YWDatePicker集成UIView // YvanDatePicker.h #import <UIKit/UIKit.h> typedef void (^selectDate)(NSDate

移动端页面弹出对话框效果Demo

核心思路:设置一个隐藏的(display:none;).背景偏暗的div及其子div作为对话框.当点击某处时,将此div设置为显示. 核心代码例如以下(部分js代码用于动态调整div内容的行高.这部分代码能够忽略): <!doctype html> <html> <head> <meta charset="utf-8"> <link rel="stylesheet" type="text/css&quo

jQuery实现的关闭页面弹出提示实例代码

jQuery实现的关闭页面弹出提示实例代码:当要关闭当前页面的时候,如果能够弹出一个提示那算是一个相当人性化的举措,因为可以防止误操作,当然也会因人而异,因为有些浏览者会感觉比较麻烦,不管怎么说,确实有这样的需求,下面就分享一下具有这个功能的代码.代码实例如下: $(window).bind('beforeunload',function(){ return '确定要离开当前页面吗'; }); 以上代码当在刷新或者关闭浏览器页面的时候会弹出提示.浏览器兼容性:1.谷歌浏览器效果良好.2.火狐浏览

JS实现边栏弹出动画

<!doctype html> <html lang="en"> <head> <meta charset="UTF-8"> <title>JS实现边栏弹出动画</title> <style type="text/css"> *{margin:0;padding:0;} #box{width:200px;height:200px;background-color:

jquery制作弹出层带遮罩效果,点击阴影部分层消失

jquery制作弹出层带遮罩效果,点击阴影部分层消失. 整体还是比较简单的. HTML代码很简单 1 <a href="#" class="big-link" data-reveal-id="myModal" data-animation="fade">jquery点我弹出</a> 2 <div id="myModal" class="reveal-modal&quo

一个JS弹出层用户登录效果

<html> <head> <meta http-equiv="Content-Type"content="text/html; charset=gb2312"/> <title>接触角测定仪 http://www.dgshengding.com</title> <style> body,#Mdown{margin: 0;padding: 0;text-align: center;font: n

jquery实战——弹出框拖拽效果

今天主要记录一下弹出框拖拽效果: 一.移动弹出窗口的步骤是:按下鼠标左键——移动鼠标——松开鼠标左键停止移动 二.主要思想: 按下鼠标左键:$('div').mousedown(function(e){}) 移动鼠标,获取鼠标当前坐标值:$(document).mousemove(function(e){}) 松开鼠标左键停止移动:$('div').mouseup(function(e){ $(document).unbind('mousemove');  //即当鼠标左键被释放时解除mouse