app年龄,星座,寻爱飘屏优化
This commit is contained in:
@@ -188,7 +188,7 @@
|
||||
_tagView.itemWidthist = _roomInfo.labelsWidthList;
|
||||
_tagView.itemList = [NSMutableArray arrayWithArray:_roomInfo.labels];
|
||||
|
||||
[_birthdayView setTitle:[self getAge] forState:UIControlStateNormal];
|
||||
[_birthdayView setTitle:[NSString getAgeWithBirth:_roomInfo.birth] forState:UIControlStateNormal];
|
||||
_birthdayView.backgroundColor = _roomInfo.gender == GenderType_Male ? UIColorFromRGB(0x6BB3FF) :UIColorFromRGB(0xFF80CC);
|
||||
_gameBgView.hidden = YES;
|
||||
_gameIconView.hidden = YES;
|
||||
@@ -222,21 +222,7 @@
|
||||
|
||||
}
|
||||
}
|
||||
-(NSString *)getAge{
|
||||
NSDateComponents *components1 = [[NSCalendar currentCalendar] components:NSCalendarUnitDay | NSCalendarUnitMonth | NSCalendarUnitYear fromDate:[NSDate dateWithTimeIntervalSince1970:_roomInfo.birth/1000]];
|
||||
NSInteger brithDateYear = [components1 year];
|
||||
NSInteger brithDateDay = [components1 day];
|
||||
NSInteger brithDateMonth = [components1 month];
|
||||
// 获取系统当前 年月日
|
||||
NSDateComponents *components2 = [[NSCalendar currentCalendar] components:NSCalendarUnitDay | NSCalendarUnitMonth | NSCalendarUnitYear fromDate:[NSDate date]]; NSInteger currentDateYear = [components2 year];
|
||||
NSInteger currentDateDay = [components2 day]; NSInteger currentDateMonth = [components2 month]; // 计算年龄
|
||||
NSInteger iAge = currentDateYear - brithDateYear - 1;
|
||||
if ((currentDateMonth > brithDateMonth) || (currentDateMonth == brithDateMonth && currentDateDay >= brithDateDay)) {
|
||||
iAge++;
|
||||
|
||||
}
|
||||
return @(iAge).stringValue;
|
||||
}
|
||||
|
||||
///声音卡时,svga是否播放动画
|
||||
-(void)setPlaySoundStatus:(BOOL)isPlay{
|
||||
_audioView.isPlay = isPlay;
|
||||
|
Reference in New Issue
Block a user