WGBEasyMarqueeView *marqueeView = [[WGBEasyMarqueeView alloc] init];
marqueeView.backgroundColor = [UIColor lightGrayColor];
marqueeView.contentMargin = 50;
marqueeView.speed = 1.5f;
[self.view addSubview: marqueeView];
if (self.marqueeType != 3) {
marqueeView.marqueeType = self.marqueeType;
marqueeView.contentView = self.label;
}else{
marqueeView.marqueeType = WGBEasyMarqueeTypeReverse;
marqueeView.contentView = self.customView;
}
self.marqueeView = marqueeView;
}
- (void)viewDidLayoutSubviews{
[super viewDidLayoutSubviews];
self.marqueeView.bounds = CGRectMake(0, 0, 300 , 60);
self.marqueeView.center = self.view.center;
}
更具体使用例子可参考demo
To run the example project, clone the repo, and run pod install
from the Example directory first.
WGBEasyMarqueeView is available through CocoaPods. To install it, simply add the following line to your Podfile:
pod 'WGBEasyMarqueeView'
Wangguibin, 864562082@qq.com
WGBEasyMarqueeView is available under the MIT license. See the LICENSE file for more info.