...
|
...
|
@@ -15,7 +15,7 @@ |
|
|
#define kBarrageTableViewWidth (245 * kScreenPointScale)
|
|
|
#define kInputTextFieldHeight 34
|
|
|
#define kInputTextFieldBottomEdge 49
|
|
|
#define kPaddingLeft 15
|
|
|
#define kPaddingLeft 13
|
|
|
#define kCloseButtonWidth 19
|
|
|
|
|
|
#define kMessageTipLeftEdge 111
|
...
|
...
|
@@ -57,13 +57,13 @@ |
|
|
[self setBottomView];
|
|
|
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(keyboardWillShow:)name:UIKeyboardWillShowNotification object:nil];
|
|
|
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(keyboardWillHide:)name:UIKeyboardWillHideNotification object:nil];
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
- (void)viewWillAppear:(BOOL)animated
|
|
|
{
|
|
|
[super viewWillAppear:animated];
|
|
|
|
|
|
|
|
|
if (self.barrageType == YHBarrageTypeSend) {
|
|
|
// 显示输入框
|
|
|
self.inputTextField.contentInset = UIEdgeInsetsMake(0, 5, 0, 5);
|
...
|
...
|
@@ -85,7 +85,7 @@ |
|
|
- (void)setBottomView
|
|
|
{
|
|
|
CGFloat scalePoint = SCREEN_HEIGHT / 667.0;
|
|
|
|
|
|
|
|
|
[self.barrageTableView setFrame:CGRectMake(0, CGRectGetHeight(self.view.bounds)-kBarrageTableViewHeight * scalePoint-kInputTextFieldBottomEdge, kBarrageTableViewWidth, kBarrageTableViewHeight * scalePoint)];
|
|
|
|
|
|
self.bottomContainerView = [[UIView alloc] initWithFrame:CGRectMake(0, CGRectGetMaxY(self.barrageTableView.frame) + 5, SCREEN_WIDTH, kInputTextFieldHeight)];
|
...
|
...
|
@@ -114,14 +114,14 @@ |
|
|
|
|
|
[self.view addSubview:self.bottomContainerView];
|
|
|
|
|
|
self.messageTip = [[UIImageView alloc] initWithFrame:CGRectMake(SCREEN_WIDTH - kMessageTipWidth - kMessageTipLeftEdge, self.barrageTableView.bottom - 5 - kMessageTipHeight, kMessageTipWidth, kMessageTipHeight)];
|
|
|
self.messageTip = [[UIImageView alloc] initWithFrame:CGRectMake(SCREEN_WIDTH - kMessageTipWidth - kMessageTipLeftEdge, self.barrageTableView.bottom - kMessageTipHeight, kMessageTipWidth, kMessageTipHeight)];
|
|
|
self.messageTip.image = [UIImage imageNamed:@"message_Tip"];
|
|
|
self.messageTip.userInteractionEnabled = YES;
|
|
|
UITapGestureRecognizer *tapGR = [[UITapGestureRecognizer alloc]initWithTarget:self action:@selector(newsBubbleClick:)];
|
|
|
tapGR.numberOfTapsRequired = 1;
|
|
|
[self.messageTip addGestureRecognizer:tapGR];
|
|
|
|
|
|
self.messageArrow = [[UIImageView alloc] initWithFrame:CGRectMake(10, 7, 10, 8)];
|
|
|
self.messageArrow = [[UIImageView alloc] initWithFrame:CGRectMake(10, 8, 10, 6)];
|
|
|
self.messageArrow.image = [UIImage imageNamed:@"messageArrow"];
|
|
|
[self.messageTip addSubview:self.messageArrow];
|
|
|
|
...
|
...
|
@@ -138,7 +138,7 @@ |
|
|
}
|
|
|
|
|
|
|
|
|
#pragma mark -
|
|
|
#pragma mark -
|
|
|
|
|
|
- (void)show
|
|
|
{
|
...
|
...
|
@@ -150,7 +150,7 @@ |
|
|
- (void)insertItem:(NSDictionary *)itemdic
|
|
|
{
|
|
|
[self.barrageTableView yhBarrageTableView:self.barrageTableView insertCellWithItem:itemdic];
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
- (void)reset
|
...
|
...
|
@@ -175,6 +175,10 @@ |
|
|
msgCount = [NSString stringWithFormat:@"%ld条信息",(long)[newMsgCount integerValue]];
|
|
|
}
|
|
|
[self.newsBubble setText:msgCount];
|
|
|
CGSize size = CGSizeMake(60,kMessageTipHeight);
|
|
|
CGSize labelsize = [self.newsBubble sizeThatFits:size];
|
|
|
[self.newsBubble setFrame:CGRectMake(25, (kMessageTipHeight - labelsize.height) / 2, labelsize.width, labelsize.height)];
|
|
|
[self.messageTip setWidth:CGRectGetMaxX(self.newsBubble.frame) + 10];
|
|
|
[self.messageTip setHidden:NO];
|
|
|
}
|
|
|
|
...
|
...
|
@@ -222,7 +226,7 @@ |
|
|
_newsBubble = [[UILabel alloc]init];
|
|
|
_newsBubble.userInteractionEnabled = YES;
|
|
|
_newsBubble.textAlignment = NSTextAlignmentCenter;
|
|
|
_newsBubble.font = [UIFont fontOfLightWithSize:11];
|
|
|
_newsBubble.font = [UIFont fontOfSCWithSize:11];
|
|
|
_newsBubble.textColor = [UIColor blackColor];
|
|
|
}
|
|
|
|
...
|
...
|
@@ -300,7 +304,7 @@ |
|
|
CGRect tRect = self.barrageTableView.frame;
|
|
|
tRect.origin.y = self.bottomContainerView.top - CGRectGetHeight(tRect) - 5;
|
|
|
self.barrageTableView.frame = tRect;
|
|
|
[self.messageTip setY:self.barrageTableView.bottom - 5 - kMessageTipHeight];
|
|
|
[self.messageTip setY:self.barrageTableView.bottom - kMessageTipHeight];
|
|
|
|
|
|
}];
|
|
|
if (self.keyBoardShowBlock) {
|
...
|
...
|
@@ -318,19 +322,19 @@ |
|
|
self.bottomContainerView.frame = iRect;
|
|
|
self.inputTextField.width = SCREEN_WIDTH - 2*kPaddingLeft;
|
|
|
self.inputTextBgView.width = SCREEN_WIDTH - 2*kPaddingLeft;
|
|
|
|
|
|
|
|
|
self.closeButtonContainer.hidden = YES;
|
|
|
|
|
|
CGRect tRect = self.barrageTableView.frame;
|
|
|
tRect.origin.y = SCREEN_HEIGHT - CGRectGetHeight(tRect) - kInputTextFieldBottomEdge;
|
|
|
self.barrageTableView.frame = tRect;
|
|
|
[self.messageTip setY:self.barrageTableView.bottom - 5 - kMessageTipHeight];
|
|
|
[self.messageTip setY:self.barrageTableView.bottom - kMessageTipHeight];
|
|
|
|
|
|
}];
|
|
|
if (self.keyBoardShowBlock) {
|
|
|
self.keyBoardShowBlock(NO, self.keyboardSize.height);
|
|
|
}
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
//- (void)showText:(NSString *)text
|
...
|
...
|
|