博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
好吧,排列组合,
阅读量:6718 次
发布时间:2019-06-25

本文共 6646 字,大约阅读时间需要 22 分钟。

//最开始的位置是依次排列的,那是开始位置,

//1隐藏2显示;1隐藏2隐藏;1显示2隐藏;1显示2显示;3始终显示

-(IBAction)creditPayView:(id)sender//如果状态是隐藏,那么打开,反之亦然;

{

    if (creditPayViewIsHidden && addCreditViewIsHidden) {

//1隐藏2隐藏--》 1显示2隐藏

        self.creditPayView.hidden = NO;

        creditPayViewIsHidden = NO;

        self.mScrollView.contentSize = CGSizeMake(320, self.mScrollView.contentSize.height +self.creditPayView.frame.size.height);

        self.phonePayView.frame = CGRectMake(0, self.phonePayView.frame.origin.y + self.creditPayView.frame.size.height, self.phonePayView.frame.size.width, self.phonePayView.frame.size.height);

        

        [self.creditImageViewsetImage:[UIImageimageNamed:@"icon_dot_selected.png"]];

        creditPaySelected = YES;

        [self.phonePayImageViewsetImage:[UIImageimageNamed:@"icon_dot_unselected.png"]];

        phonePaySelected = NO;

        

        [self.addCreditImageViewsetImage:[UIImageimageNamed:@"berth_icon_unselected.png"]];

        addCreditPaySelected = NO;

        

        

    }elseif (!creditPayViewIsHidden && addCreditViewIsHidden) {

//1显示2隐藏---》1隐藏2隐藏

        self.creditPayView.hidden = YES;

        creditPayViewIsHidden = YES;

        self.mScrollView.contentSize = CGSizeMake(320, self.mScrollView.contentSize.height - self.creditPayView.frame.size.height);

        self.phonePayView.frame = CGRectMake(0, self.phonePayView.frame.origin.y - self.creditPayView.frame.size.height, self.phonePayView.frame.size.width, self.phonePayView.frame.size.height);

        

        [self.creditImageViewsetImage:[UIImageimageNamed:@"icon_dot_unselected.png"]];

        creditPaySelected = NO;

        [self.addCreditImageViewsetImage:[UIImageimageNamed:@"berth_icon_unselected.png"]];

        addCreditPaySelected = NO;

        

    }elseif(!creditPayViewIsHidden && !addCreditViewIsHidden){

//1显示2显示---》1隐藏2隐藏

        self.creditPayView.hidden = YES;

        self.addCreditView.hidden = YES;

        creditPayViewIsHidden = YES;

        addCreditViewIsHidden = YES;

        self.mScrollView.contentSize = CGSizeMake(320, self.mScrollView.contentSize.height - self.creditPayView.frame.size.height - self.addCreditView.frame.size.height);

        self.phonePayView.frame = CGRectMake(0, self.phonePayView.frame.origin.y - self.creditPayView.frame.size.height - self.addCreditView.frame.size.height, self.phonePayView.frame.size.width, self.phonePayView.frame.size.height);

        

        [self.creditImageViewsetImage:[UIImageimageNamed:@"icon_dot_unselected.png"]];

        creditPaySelected = NO;

        [self.addCreditImageViewsetImage:[UIImageimageNamed:@"berth_icon_unselected.png"]];

        addCreditPaySelected = NO;

    }

    elseif(1==1){

//1显示2显示 --》1隐藏2显示 不存在

        

    }

    elseif(1==1){

//1显示2隐藏 ---》1显示2显示 不存在

        

    }

    

    [self.viewsetNeedsDisplay];

}

 

-(IBAction)addCreditView:(id)sender

{

    if (addCreditViewIsHidden && creditPayViewIsHidden) {

//1隐藏2隐藏--》2显示1隐藏  不存在

        self.addCreditView.hidden = NO;

        addCreditViewIsHidden = NO;

    }elseif (!creditPayViewIsHidden && addCreditViewIsHidden) //1显示2隐藏---》1显示2显示

    {

        self.addCreditView.hidden = NO;

        addCreditViewIsHidden = NO;

        self.mScrollView.contentSize = CGSizeMake(320, self.mScrollView.contentSize.height + self.addCreditView.frame.size.height);

        self.phonePayView.frame = CGRectMake(0, self.phonePayView.frame.origin.y + self.addCreditView.frame.size.height, self.phonePayView.frame.size.width, self.phonePayView.frame.size.height);

        

        [self.creditImageViewsetImage:[UIImageimageNamed:@"icon_dot_selected.png"]];

        creditPaySelected = YES;

        [self.phonePayImageViewsetImage:[UIImageimageNamed:@"icon_dot_unselected.png"]];

        phonePaySelected = NO;

        [self.addCreditImageViewsetImage:[UIImageimageNamed:@"berth_icon_selected.png"]];

        addCreditPaySelected = YES;

        

    }elseif(!creditPayViewIsHidden && !addCreditViewIsHidden)//1显示2显示--》1显示2隐藏

    {

        self.addCreditView.hidden = YES;

        addCreditViewIsHidden = YES;

        self.mScrollView.contentSize = CGSizeMake(320, self.mScrollView.contentSize.height - self.addCreditView.frame.size.height);

        self.phonePayView.frame = CGRectMake(0, self.phonePayView.frame.origin.y - self.addCreditView.frame.size.height, self.phonePayView.frame.size.width, self.phonePayView.frame.size.height);

        

        [self.creditImageViewsetImage:[UIImageimageNamed:@"icon_dot_selected.png"]];

        creditPaySelected = YES;

        [self.phonePayImageViewsetImage:[UIImageimageNamed:@"icon_dot_unselected.png"]];

        phonePaySelected = NO;

        

        [self.addCreditImageViewsetImage:[UIImageimageNamed:@"berth_icon_unselected.png"]];

        addCreditPaySelected = NO;

        

    }

    [self.viewsetNeedsDisplay];

}

 

 

-(IBAction)changeSelectedState:(id)sender

{

//9,钱包支付,10,信用卡支付,11,新信用卡支付 12,支付宝支付

    UIButton *btn = (UIButton *)sender;

    switch (btn.tag) {

        case 9:

            if (pocketPaySelected) {

                [self.pocketImageViewsetImage:[UIImageimageNamed:@"berth_icon_unselected.png"]];

                pocketPaySelected = NO;

            }else{

                [self.pocketImageView setImage:[UIImage imageNamed:@"berth_icon_selected.png"]];

                pocketPaySelected = YES;

 

            }

            break;

        case 10:

 

            break;

        case 11:

 

            break;

        

        default:

            if (phonePaySelected) {

                [self.phonePayImageView setImage:[UIImage imageNamed:@"icon_dot_unselected.png"]];

                phonePaySelected = NO;

            }else{

                [self.phonePayImageView setImage:[UIImage imageNamed:@"icon_dot_selected.png"]];

                phonePaySelected = YES;

                [self.creditImageView setImage:[UIImage imageNamed:@"icon_dot_unselected.png"]];

                creditPaySelected = NO;

                [self.addCreditImageViewsetImage:[UIImageimageNamed:@"berth_icon_unselected.png"]];

                addCreditPaySelected = NO;

                

                if (!creditPayViewIsHidden && addCreditViewIsHidden) {

//1显示2隐藏---》1隐藏2隐藏

                    self.creditPayView.hidden = YES;

                    creditPayViewIsHidden = YES;

                    self.mScrollView.contentSize = CGSizeMake(320, self.mScrollView.contentSize.height - self.creditPayView.frame.size.height);

                    self.phonePayView.frame = CGRectMake(0, self.phonePayView.frame.origin.y - self.creditPayView.frame.size.height, self.phonePayView.frame.size.width, self.phonePayView.frame.size.height);

                    

                    [self.creditImageView setImage:[UIImage imageNamed:@"icon_dot_unselected.png"]];

                    creditPaySelected = NO;

                    [self.addCreditImageView setImage:[UIImage imageNamed:@"berth_icon_unselected.png"]];

                    addCreditPaySelected = NO;

                    

                }

                

                if(!creditPayViewIsHidden && !addCreditViewIsHidden){

//1显示2显示---》1隐藏2隐藏

                    self.creditPayView.hidden = YES;

                    self.addCreditView.hidden = YES;

                    creditPayViewIsHidden = YES;

                    addCreditViewIsHidden = YES;

                    self.mScrollView.contentSize = CGSizeMake(320, self.mScrollView.contentSize.height - self.creditPayView.frame.size.height - self.addCreditView.frame.size.height);

                    self.phonePayView.frame = CGRectMake(0, self.phonePayView.frame.origin.y - self.creditPayView.frame.size.height - self.addCreditView.frame.size.height, self.phonePayView.frame.size.width, self.phonePayView.frame.size.height);

                    

                    [self.creditImageView setImage:[UIImage imageNamed:@"icon_dot_unselected.png"]];

                    creditPaySelected = NO;

                    [self.addCreditImageView setImage:[UIImage imageNamed:@"berth_icon_unselected.png"]];

                    addCreditPaySelected = NO;

                }

                

            }

            

            break;

    }

}

转载于:https://www.cnblogs.com/guligei/archive/2013/04/23/3037953.html

你可能感兴趣的文章
记录一次Webpack插件优化的经历
查看>>
【跃迁之路】【505天】程序员高效学习方法论探索系列(实验阶段262-2018.06.25)...
查看>>
ubuntu16.04 搭建java 环境
查看>>
关于 try 和 finally 中的 return
查看>>
JS 1-数据类型
查看>>
(Google I/O '17) Speeding Up Your Android Gradle Builds 在本地的实践
查看>>
最大似然法与似然函数
查看>>
SAPGUI里实现自定义的语法检查
查看>>
快速创建 HTML5 Canvas 电信网络拓扑图
查看>>
JS动画之定时器详解
查看>>
利用Tomcat发布基于Maven所构建的Jersey RESTful Web Service
查看>>
PHP之string之wordwrap()函数使用
查看>>
ABAP OPEN SQL里OPEN CURSOR和SELECT的比较
查看>>
【348天】我爱刷题系列107(2018.01.19)
查看>>
四谈快速排序(含尾递归)
查看>>
WPF 下的自定义控件以及 Grid 中控件的自适应
查看>>
来一场轰轰烈烈的HTTP协议扫盲革命
查看>>
mongodb安装和配置
查看>>
touch事件兼容性处理
查看>>
prerender-spa-plugin 预渲染插件的使用说明
查看>>