无限循环 图片轮播器

使用方法:(注意:如果使用autoLayout适配,需要先做完适配,再给图片数组赋值。)
YJBannerView * bannerView = [[ YJBannerView alloc ] initWithFrame : CGRectMake ( 0 , 0 , 0 , 0 )];
    [
self . view addSubview :bannerView];
    [bannerView
setTranslatesAutoresizingMaskIntoConstraints : NO ];
    [
self . view addConstraints :[ NSLayoutConstraint constraintsWithVisualFormat : @"V:|[bannerView(300)]->=0-|" options : 0 metrics : nil views : NSDictionaryOfVariableBindings (bannerView)]];
    [
self . view addConstraints :[ NSLayoutConstraint constraintsWithVisualFormat : @"H:|[bannerView]|" options : 0 metrics : nil views : NSDictionaryOfVariableBindings (bannerView)]];
    bannerView.imageArray = imageArray;

gitHub地址: https://github.com/pilgrim1385/YJBannerView

你可能感兴趣的:(图片轮播器,无限循环)