//最开始的位置是依次排列的,那是开始位置,
//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;
}
}