Skip to content

Commit e7e4f5c

Browse files
sumengsumeng
authored andcommitted
录音超过55秒,时间显示变色
1 parent cc485cc commit e7e4f5c

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

Coding_iOS/Views/UIMessageInputView/UIMessageInputView_Voice.m

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
#import "UIMessageInputView_Voice.h"
1010
#import "AudioRecordView.h"
1111
#import "AudioVolumeView.h"
12+
#import "AudioManager.h"
1213

1314
typedef NS_ENUM(NSInteger, UIMessageInputView_VoiceState) {
1415
UIMessageInputView_VoiceStateReady,
@@ -81,7 +82,12 @@ - (void)setState:(UIMessageInputView_VoiceState)state {
8182
_volumeRightView.hidden = YES;
8283
break;
8384
case UIMessageInputView_VoiceStateRecording:
84-
_recordTipsLabel.textColor = [UIColor colorWithRGBHex:0x2faeea];
85+
if (_duration < ([AudioManager shared].maxRecordDuration - 5)) {
86+
_recordTipsLabel.textColor = [UIColor colorWithRGBHex:0x2faeea];
87+
}
88+
else {
89+
_recordTipsLabel.textColor = [UIColor colorWithRGBHex:0xDE4743];
90+
}
8591
_recordTipsLabel.text = [self formattedTime:_duration];
8692
break;
8793
case UIMessageInputView_VoiceStateCancel:

0 commit comments

Comments
 (0)