JLBannerView 1.11

JLBannerView 1.11

测试已测试
语言语言 Obj-CObjective C
许可证 MIT
发布最新发布2017年10月

Jang sukyong 维护。



  • hmhv




特性

安装

CocoaPods

platform :ios, '8.0'
pod 'JLBannerView'

用法

导入头文件

#import <JLBannerView/JLBannerView.h>

代码示例

- (void)viewDidLoad {
    [super viewDidLoad];

    JLBannerView *bannerView = [[JLBannerView alloc] initWithFrame:CGRectMake(0, 0, 320, 200)];
    bannerView.delegate = self;
    bannerView.dataSource = self;
    [bannerView reloadData];
}

#pragma mark - JLBannerViewDataSource

- (NSInteger)numberOfItemsInBannerView:(JLBannerView *)bannerView {
    return 10;
}

- (UIView *)bannerView:(JLBannerView *)bannerView reusableItemView:(UIView *)reusableItemView forItemAtIndex:(NSInteger)index {    
    UILabel *label = (UILabel *)reusableItemView;
    if ([label isKindOfClass:[UILabel class]]) {
        label = [[UILabel alloc] init];
        label.textAlignment = NSTextAlignmentCenter;
        label.font = [UIFont systemFontOfSize:35 weight:UIFontWeightMedium];
    }
    
    label.text = [NSString stringWithFormat:@"%zd",index];
    return label;
}

#pragma mark - JLBannerViewDelegate

- (void)bannerView:(JLBannerView *)bannerView didSelectItemAtIndex:(NSInteger)index {
    NSLog(@"index : %zd",index);
}

循环

@property (nonatomic, assign) IBInspectable BOOL shouldLoop; // default is YES

自动滚动

@property (nonatomic, assign) IBInspectable BOOL autoScrolling; // default is NO
@property (nonatomic, assign) IBInspectable CGFloat scrollInterval; // default is 5

待办事项

  • 支持横幅模式

许可证

MIT 许可证 (MIT)

版权所有 (c) 2016 jangsy7883

特此授予任何获得此软件及其相关文档文件(以下简称“软件”)副本的人免费权利
使用、复制、修改、合并、出版、分发、再许可和/或销售软件的副本,并允许有权提供软件的人作此处理,前提是必须遵守以下条件
上述版权声明和本许可声明应包含在所有软件副本或实质性部分的软件中。
软件按“原样”提供,不提供任何类型、明示或暗示的保证,包括但不限于适销性、特定用途适合性和非侵权性。
在任何情况下,作者或版权所有者不应对任何索赔、损害或其他责任负责,无论此类索赔、损害或其他责任是否源于合同、侵权或其他行为,与软件或使用或其它有关。
是否在软件中使用、出售或其它商业运作中。

软件中所含技术的任何声明或保证均为无效的。
此举并不表示软件的任一部分被授权或分配给任何组织的任何产品或服务。

软件是被许可的,并非出售。
软件的授予并不构成对专利、商标或任何其它知识产权的任何其他权利或利益的转让。
软件的获得并不授予任何与此相关的任何 mogąClayton Act》,或其他州或国家法律所禁止的联合或合并行为的规定。
或其它法律所禁止的行为。
软件获得不受任何限制或保证,包括但不限于对适销性、特定目的适用性和非侵权的保证。
赔偿或损坏,无论是由于软件的使用或其它方式,都不应当由软件的提供者负任何责任。
并确保软件可以与任何可能购买的软件或服务兼容。