Giter Site home page Giter Site logo

marquee's Introduction

marquee

这是一个跑马灯

// 所有颜色不设置的话就是默认随机生成 /******************************************************************************/ lineMarquee = [[BQLMarquee alloc] initWithType:BQLMarqueeTypeLine Text:@"哈哈哈哈哈哈哈" Roll:nil]; lineMarquee.marqueeCustomSpeed = 10; lineMarquee.frame = CGRectMake(10, 70, self.view.frame.size.width - 80, 40); [self.view addSubview:lineMarquee]; [lineMarquee start];

/******************************************************************************/ BQLMarquee *lineMarquee1 = [[BQLMarquee alloc] initWithFrame:CGRectMake(10, lineMarquee.frame.origin.y + lineMarquee.frame.size.height + 10, self.view.frame.size.width - 20, 40) Type:BQLMarqueeTypeLine Text:@"恭喜你成为我们的幸运观众!" Roll:nil]; [self.view addSubview:lineMarquee1]; lineMarquee1.marqueeBackgroundColor = [UIColor whiteColor]; lineMarquee1.marqueeTextColor = [UIColor blueColor]; lineMarquee1.marqueeFont = [UIFont systemFontOfSize:16]; [lineMarquee1 start];

/******************************************************************************/
BQLMarquee *roll0 = [[BQLMarquee alloc] initWithFrame:CGRectMake(10, lineMarquee1.frame.origin.y + lineMarquee1.frame.size.height + 10, self.view.frame.size.width - 20, 40) Type:BQLMarqueeTypeRoll Text:nil Roll:@[@"这是一个公告,请注意"]];
[self.view addSubview:roll0];
roll0.didClickAtIndexBlock = ^(NSInteger index) {
    
    NSLog(@"点击了第%ld个",index);
};

/******************************************************************************/ BQLMarquee *roll1 = [[BQLMarquee alloc] initWithType:BQLMarqueeTypeRoll Text:nil Roll:@[@"蒙多~想去就去哪",@"无形之刃,最为致命",@"提莫队长,正在待命"]]; roll1.frame = CGRectMake(10, roll0.frame.origin.y + roll0.frame.size.height + 10, self.view.frame.size.width - 20, 40); roll1.marqueeTextAlignment = NSTextAlignmentCenter; roll1.rollType = BQLMarqueeRollTypeUp; [self.view addSubview:roll1]; roll1.didClickAtIndexBlock = ^(NSInteger index) {

    NSLog(@"点击了第%ld个",index);
};

/******************************************************************************/ BQLMarquee *roll2 = [[BQLMarquee alloc] initWithFrame:CGRectMake(10, roll1.frame.origin.y + roll1.frame.size.height + 10, self.view.frame.size.width - 20, 40) Type:BQLMarqueeTypeRoll Text:nil Roll:@[@"犯我德邦者,虽远必诛",@"快去找点乐子吧",@"只要998,让你爽到家",@"还有谁?还有谁!"]]; [self.view addSubview:roll2]; roll2.rollType = BQLMarqueeRollTypeDown; roll2.marqueeTextColor = [UIColor redColor]; roll2.didClickAtIndexBlock = ^(NSInteger index) {

    NSLog(@"点击了第%ld个",index);
};

/******************************************************************************/ BQLMarquee *roll3 = [[BQLMarquee alloc] initWithFrame:CGRectMake(10, roll2.frame.origin.y + roll2.frame.size.height + 10, self.view.frame.size.width - 20, 40) Type:BQLMarqueeTypeRoll Text:nil Roll:@[@"我最喜欢薛之谦的两首歌",@"一首叫:演员",@"另一首叫:丑八怪"]]; [self.view addSubview:roll3]; roll3.marqueeTextAlignment = NSTextAlignmentRight; roll3.didClickAtIndexBlock = ^(NSInteger index) {

    NSLog(@"点击了第%ld个",index);
};

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.