diff --git a/CustomKeyboard/View/KBFunctionBarView.m b/CustomKeyboard/View/KBFunctionBarView.m index 27ba738..655c561 100644 --- a/CustomKeyboard/View/KBFunctionBarView.m +++ b/CustomKeyboard/View/KBFunctionBarView.m @@ -18,6 +18,7 @@ @end @implementation KBFunctionBarView +static const CGFloat kKBBackButtonWidth = 40; - (instancetype)initWithFrame:(CGRect)frame{ if (self = [super initWithFrame:frame]) { @@ -83,14 +84,14 @@ UIButton *appButton = [UIButton buttonWithType:UIButtonTypeCustom]; appButton.tag = 100; // 左侧 index = 0 UIImage *appImage = [UIImage imageNamed:@"App_icon"]; - [appButton setImage:appImage forState:UIControlStateNormal]; + [appButton setBackgroundImage:appImage forState:UIControlStateNormal]; appButton.imageView.contentMode = UIViewContentModeScaleAspectFit; appButton.adjustsImageWhenHighlighted = YES; [appButton addTarget:self action:@selector(onLeftTap:) forControlEvents:UIControlEventTouchUpInside]; [self.leftContainer addSubview:appButton]; [appButton mas_makeConstraints:^(MASConstraintMaker *make) { make.center.equalTo(self.leftContainer); - make.width.height.mas_equalTo(34); // 设计图尺寸 + make.width.height.mas_equalTo(kKBBackButtonWidth); // 设计图尺寸 }]; self.leftButtonsInternal = @[appButton];