Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

adImgView懒加载方法,没设置contentmode #6

Closed
ghost opened this issue Aug 24, 2016 · 0 comments
Closed

adImgView懒加载方法,没设置contentmode #6

ghost opened this issue Aug 24, 2016 · 0 comments

Comments

@ghost
Copy link

ghost commented Aug 24, 2016

-(UIImageView *)adImgView
{
    if(_adImgView==nil)
    {
        _adImgView = [[UIImageView alloc] initWithFrame:_adFrame];
        _adImgView.userInteractionEnabled = YES;
        _adImgView.alpha = 0.2;
        _adImgView.contentMode = UIViewContentModeScaleAspectFill;  // -->newly
        _adImgView.clipsToBounds = YES;  // -->newly
        UITapGestureRecognizer* tap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(tapAction:)];
        [_adImgView addGestureRecognizer:tap];
    }
    return _adImgView;
}

当然,这不算是什么issue哈,只是个人比较习惯这样,不然某些图片被缩放变形了,看着怪怪的

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant