pushbackDemo(Modalview present)

//
//  RootViewController.m
//  PushBackDemo
//
//  Created by huangyibiao on 14-8-22.
//  Copyright (c) 2014骞� Uni2Uni. All rights reserved.
//

#import "RootViewController.h"

@interface RootViewController () {
    UIView *_modalView;
    UIView *_bgView;
}

@end

@implementation RootViewController

- (void)viewDidLoad {
    [super viewDidLoad];

    CGFloat y = [UIDevice currentDevice].systemVersion.integerValue >= 7 ? 64 : 0;
    _bgView = [[UIView alloc] initWithFrame:self.view.bounds];
    _bgView.frame = CGRectMake(0, y, self.view.bounds.size.width, self.view.bounds.size.height);
    _bgView.backgroundColor = [UIColor greenColor];
    [self.view addSubview:_bgView];

    UIButton *btn = [UIButton buttonWithType:UIButtonTypeCustom];
    [btn setTitle:@"鏄剧ず" forState:UIControlStateNormal];
    [btn setFrame:CGRectMake(100, 50, 120, 30)];
    [btn addTarget:self action:@selector(show) forControlEvents:UIControlEventTouchUpInside];
    [_bgView addSubview:btn];

    _modalView = [[UIView alloc] initWithFrame:CGRectMake(0, self.view.frame.size.height, 320, 250)];
    [self.view addSubview:_modalView];
    _modalView.backgroundColor = [UIColor redColor];

    btn = [UIButton buttonWithType:UIButtonTypeCustom];
    [btn setTitle:@"闅愯棌" forState:UIControlStateNormal];
    [btn setFrame:CGRectMake(100, 50, 120, 30)];
    [btn addTarget:self action:@selector(hide) forControlEvents:UIControlEventTouchUpInside];
    [_modalView addSubview:btn];
    return;
}

- (void)hide {
    _bgView.userInteractionEnabled = YES;
    [UIView animateWithDuration:0.3 animations:^{
        _bgView.alpha = 0.35;
    } completion:^(BOOL finished) {
        [UIView animateWithDuration:0.3 animations:^{
            _bgView.transform = CGAffineTransformMakeScale(1.0, 1.0);
            self.navigationController.navigationBar.transform = CGAffineTransformMakeScale(1.0, 1.0);
            _modalView.alpha = 0.0;

            _modalView.frame = CGRectMake(0, _bgView.frame.size.height,
                                          _modalView.frame.size.width,
                                          _modalView.frame.size.height);
            _bgView.alpha = 1.0;
            CGFloat y = [UIDevice currentDevice].systemVersion.integerValue >= 7 ? 64 : 0;
            _bgView.frame = CGRectMake(0, y, 320, _bgView.frame.size.height);
        }];
    }];
}

- (void)show {
    _bgView.userInteractionEnabled = NO;
    [UIView animateWithDuration:0.3 animations:^{
        _modalView.alpha = 1;
        _modalView.frame = CGRectMake(0, _bgView.frame.size.height - _modalView.frame.size.height, _modalView.frame.size.width, _modalView.frame.size.height);
        _bgView.alpha = 0.35;

    } completion:^(BOOL finished) {
        [UIView animateWithDuration:0.3 animations:^{
                    _bgView.frame = CGRectMake(0, _bgView.frame.origin.y - 64 * 0.5, 320, _bgView.frame.size.height);
            _bgView.transform = CGAffineTransformMakeScale(0.9, 0.9);
            self.navigationController.navigationBar.transform = CGAffineTransformMakeScale(0.9, 0.6);
            _bgView.alpha = 0.5;
        }];
    }];
}

@end
时间: 2024-12-03 11:50:51

pushbackDemo(Modalview present)的相关文章

Bringing up interface eth0: Device eth0 does not seem to be present, delaying initialization

执行 service network restart  出现了网卡无法启动,说找到不到 Bringing up interface eth0: Device eth0 does not seem to be present, delaying initialization 解决办法: 1> 修改/etc/udev/rules.d/70-persistent-net.rules文件,删除或注释掉第一个网卡记录,并将第二个的NAME="eth1"改为NAME="eth0&q

Struts 中bean:present使用方法

   在做一个用Struts做的电子商务项目时,遇到了一个这样的问题:未登陆用户购买商品时,要显示用户登陆画面:而登陆用户购买商品时,则不显示登陆画面而显示用户信息.可以用struts 1.1 的bean:present实现:     在JSP页面头部一定要加上相应的<%@ taglib 等标记,否则无法实现.我开始时就是忘了加<%@ taglib uri="http://jakarta.apache.org/struts/tags-logic" prefix="

CentOS Linux解决Device eth0 does not seem to be present

一,问题描述 在VMware里克隆出来的CentOS Linux.. ifconfig...没有看到eth0..然后重启网卡又报下面错误. 故障现象: service network restart Shutting down loopback insterface:                                                   [ OK ] Bringing up loopback insterface:                          

Linux解决Device eth0 does not seem to be present

  CentOS Linux解决Device eth0 does not seem to be present 在VMware里克隆出来的CentOS Linux.. ifconfig...没有看到eth0..然后重启网卡又报下面错误. 故障现象: 解决办法: 首先,打开/etc/udev/rules.d/70-persistent-net.rules内容如下面例子所示: # vi /etc/udev/rules.d/70-persistent-net.rules # This file was

CentOS Linux解决网卡启动时候报Device eth0 does not seem to be present错误

  在VMware里克隆出来的CentOS Linux.. ifconfig...没有看到eth0..然后重启网卡又报下面错误. 故障现象: service network restart Shutting down loopback insterface: [ OK ] Bringing up loopback insterface: [ OK ] Bringing up interface eth0: Device eth0 does not seem to be present,delay

Required CommonsMultipartFile parameter &amp;#39;pic&amp;#39; is not present

org.springframework.web.bind.MissingServletRequestParameterException: Required CommonsMultipartFile parameter 'pic' is not present 在项目中我们优势有时会遇到这种异常,这是因为我们使用了CommonsMultipartFile 对象,但并未接收到这个对象,可以理解为参数名不对,也可以理解为传过来的CommonsMultipartFile对象为null,给该对象设置为不

iOS 7 present/dismiss自定义转场动画

前言 iOS 7以后提供了自定义转场动画的功能,我们可以通过遵守协议完成自定义转场动画.本篇文章讲解如何实现自定义present.dismiss自定义动画. 关于自定义push/pop转场动画,请阅读iOS 7 push/pop自定义转场动画 效果图 本篇文章实现的动画切换效果图如下: 视图切换种类 如下效果图,这是有两大类视图切换动画的,一种是交互式的,另一种就是自定义的. 本篇只讲其中的UIViewControllerAnimatedTransitioning协议,来实现present.di

present新界面然后dismiss回到以前界面,自定义Tabbar出现问题,不隐藏

问题描述 present新界面然后dismiss回到以前界面,自定义Tabbar出现问题,不隐藏 是这样的,我这边判断用户是否登录,如果木有登录就present[登陆界面], 在点击[登录界面]中[登录]按钮时,进行dismiss让[登录界面]消失,回到登录前的界面,问题是我登录dismiss之后自定义的Tabbar竟然显示了,我这边Tabbar竟然不隐藏了,我在ViewWillapper里面进行了隐藏,但是还是会出现,是为什么

centos网卡错误Device eth0 does not seem to be present

在使用vmware及VirtualBox迁移linux系统过程中,发现部署后的linux系统无法启动网卡 报错为 Bringing up interface eth0: Device eth0 does not seem to be present,delaying initialization 错误原因,是因为linux网卡绑定了原mac地址导致   解决方法为 1.使用ifcnfig -a 查看当前主机mac地址 2.修改eth0网卡硬件地址为当前地址 vi /etc/sysconfig/n