首页 > 系统 > iOS > 正文

iOS - 图片拉伸

2019-11-09 16:45:48
字体:
来源:转载
供稿:网友
- (UIButton *)_createToolbarButton {    UIButton *btn = [UIButton buttonWithType:UIButtonTypeCustom];    btn.exclusiveTouch = YES;    btn.size = CGSizeMake(kScreenWidth / _emoticonGroups.count, kToolbarHeight);    btn.titleLabel.font = [UIFont systemFontOfSize:14];    [btn setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal];    [btn setTitleColor:UIColorHex(5D5C5A) forState:UIControlStateSelected];        UIImage *img;    img = [YHExPRessionHelper imageNamed:@"compose_emotion_table_left_normal"];    img = [img resizableImageWithCapInsets:UIEdgeInsetsMake(0, 0, 0, img.size.width - 1) resizingMode:UIImageResizingModeStretch];    [btn setBackgroundImage:img forState:UIControlStateNormal];        img = [YHExpressionHelper imageNamed:@"compose_emotion_table_left_selected"];    img = [img resizableImageWithCapInsets:UIEdgeInsetsMake(0, 0, 0, img.size.width - 1) resizingMode:UIImageResizingModeStretch];    [btn setBackgroundImage:img forState:UIControlStateSelected];        [btn addTarget:self action:@selector(_toolbarBtnDidTapped:) forControlEvents:UIControlEventTouchUpInside];    return btn;}
发表评论 共有条评论
用户名: 密码:
验证码: 匿名发表