重构了表情的View
This commit is contained in:
@@ -24,12 +24,14 @@
|
||||
///View
|
||||
#import "XPRoomSendTextView.h"
|
||||
#import "XPSendGiftView.h"
|
||||
#import "XPRoomFaceView.h"
|
||||
#import "SessionListViewController.h"
|
||||
#import "XPRoomMoreMenuViewController.h"
|
||||
#import "XPNobleCenterViewController.h"
|
||||
#import "XPRoomFaceViewController.h"
|
||||
|
||||
@interface XPRoomMenuContainerView ()
|
||||
///滚动的容器
|
||||
@property (nonatomic,strong) UIScrollView *scrollView;
|
||||
///
|
||||
@property (nonatomic,strong) UIStackView *stackView;
|
||||
///输入框
|
||||
@@ -50,8 +52,6 @@
|
||||
@property (nonatomic,strong) UIButton *arrangeMicButton;
|
||||
///贵族
|
||||
@property (nonatomic,strong) UIButton *nobleButton;
|
||||
///占位的
|
||||
@property (nonatomic,strong) UIView * placeHolderView;
|
||||
///代理
|
||||
@property (nonatomic,weak) id<RoomHostDelegate> delegate;
|
||||
@end
|
||||
@@ -95,10 +95,10 @@
|
||||
break;
|
||||
|
||||
case XPRoomMenuItemType_Face: {
|
||||
NSString * roomUid = [NSString stringWithFormat:@"%ld", [self.delegate getRoomInfo].uid];
|
||||
XPRoomFaceView * faceView = [[XPRoomFaceView alloc] initWithRoomUid:roomUid];
|
||||
faceView.delegate = self.delegate;
|
||||
[TTPopup popupView:faceView style:TTPopupStyleActionSheet];
|
||||
XPRoomFaceViewController * faceVC = [[XPRoomFaceViewController alloc] init];
|
||||
faceVC.modalPresentationStyle = UIModalPresentationOverFullScreen;
|
||||
faceVC.roomId = [NSString stringWithFormat:@"%ld", self.delegate.getRoomInfo.roomId];
|
||||
[self.delegate.getCurrentNav presentViewController:faceVC animated:YES completion:nil];
|
||||
}
|
||||
break;
|
||||
case XPRoomMenuItemType_Gift: {
|
||||
@@ -158,7 +158,11 @@
|
||||
|
||||
#pragma mark - Private Method
|
||||
- (void)initSubViews {
|
||||
[self addSubview:self.stackView];
|
||||
[self addSubview:self.scrollView];
|
||||
[self addSubview:self.giftButton];
|
||||
|
||||
[self.scrollView addSubview:self.stackView];
|
||||
|
||||
[self.stackView addArrangedSubview:self.inputButton];
|
||||
[self.stackView addArrangedSubview:self.micButton];
|
||||
[self.stackView addArrangedSubview:self.voiceButton];
|
||||
@@ -167,21 +171,26 @@
|
||||
[self.stackView addArrangedSubview:self.messageButton];
|
||||
[self.stackView addArrangedSubview:self.moreButton];
|
||||
[self.stackView addArrangedSubview:self.nobleButton];
|
||||
[self.stackView addArrangedSubview:self.placeHolderView];
|
||||
[self.stackView addArrangedSubview:self.giftButton];
|
||||
}
|
||||
|
||||
- (void)initSubViewConstraints {
|
||||
[self.stackView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.left.right.mas_equalTo(self).inset(15);
|
||||
[self.scrollView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.left.mas_equalTo(self).offset(15);
|
||||
make.right.mas_equalTo(self.giftButton.mas_left).offset(-10);
|
||||
make.top.bottom.mas_equalTo(self);
|
||||
}];
|
||||
|
||||
[self.stackView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.top.bottom.leading.trailing.height.mas_equalTo(self.scrollView);
|
||||
}];
|
||||
|
||||
[self.inputButton mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.size.mas_equalTo(CGSizeMake(100, 30));
|
||||
}];
|
||||
|
||||
[self.giftButton mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.centerY.mas_equalTo(self);
|
||||
make.right.mas_equalTo(self).offset(-15);
|
||||
make.size.mas_equalTo(CGSizeMake(38, 38));
|
||||
}];
|
||||
}
|
||||
@@ -440,15 +449,6 @@
|
||||
return _giftButton;
|
||||
}
|
||||
|
||||
- (UIView *)placeHolderView {
|
||||
if (!_placeHolderView) {
|
||||
_placeHolderView = [[UIView alloc] init];
|
||||
_placeHolderView.backgroundColor = [UIColor clearColor];
|
||||
[_placeHolderView setContentHuggingPriority:UILayoutPriorityDragThatCanResizeScene forAxis:UILayoutConstraintAxisHorizontal];
|
||||
}
|
||||
return _placeHolderView;
|
||||
}
|
||||
|
||||
- (UIStackView *)stackView {
|
||||
if (!_stackView) {
|
||||
_stackView = [[UIStackView alloc] init];
|
||||
@@ -472,4 +472,13 @@
|
||||
return _arrangeMicButton;
|
||||
}
|
||||
|
||||
- (UIScrollView *)scrollView {
|
||||
if (!_scrollView) {
|
||||
_scrollView = [[UIScrollView alloc] init];
|
||||
_scrollView.backgroundColor = [UIColor clearColor];
|
||||
_scrollView.showsHorizontalScrollIndicator = NO;
|
||||
}
|
||||
return _scrollView;
|
||||
}
|
||||
|
||||
@end
|
||||
|
Reference in New Issue
Block a user