Skip to content
This repository has been archived by the owner on Jul 14, 2020. It is now read-only.

Commit

Permalink
fix the inconsistency of the keyboard's initial size
Browse files Browse the repository at this point in the history
  • Loading branch information
YuAo committed Feb 25, 2015
1 parent f44c317 commit 3fc8a0d
Showing 1 changed file with 4 additions and 8 deletions.
12 changes: 4 additions & 8 deletions WUEmoticonsKeyboard/WUEmoticonsKeyboard.m
Original file line number Diff line number Diff line change
Expand Up @@ -115,26 +115,22 @@ - (void)backspace {
#pragma mark - create & init

- (id)init {
return [self initWithFrame:CGRectZero];
return [self initWithFrame:(CGRect){CGPointZero,WUEmoticonsKeyboardDefaultSize}];
}

- (id)initWithFrame:(CGRect)frame {
if (self = [super initWithFrame:frame]) {
[self setup];
[self setupEmoticonsKeyboard];
}
return self;
}

- (void)awakeFromNib {
[super awakeFromNib];
[self setup];
[self setupEmoticonsKeyboard];
}

- (void)setup {
if (CGRectIsEmpty(self.bounds)) {
self.bounds = (CGRect){CGPointZero,WUEmoticonsKeyboardDefaultSize};
}

- (void)setupEmoticonsKeyboard {
self.backgroundColor = [UIColor blackColor];

UIImageView *backgroundImageView = [[UIImageView alloc] initWithFrame:self.bounds];
Expand Down

0 comments on commit 3fc8a0d

Please sign in to comment.