目标效果:

让字符串滚动显示

样式代码:

            UILabel *labJzmcTitle = [[UILabel alloc]init];
            [labJzmcTitle setBackgroundColor:[UIColor clearColor]]; 
            labJzmcTitle.text=@"基站名称:";
            [labJzmcTitle setTextColor:[UIColor whiteColor]];
            labJzmcTitle.frame = CGRectMake(6, i*210+45, 80, 30);
            [calloutMapAnnotationView.contentView addSubview:labJzmcTitle];
            
            NSArray *tickerStrings = [NSArray arrayWithObjects:offStationView.alarmNode, nil];
            JHTickerView *ticker = [[JHTickerView alloc] initWithFrame:CGRectMake(83, i*210+42, 100, 30)];
            [ticker setBackgroundColor:[UIColor clearColor]];
            [ticker setDirection:JHTickerDirectionLTR];
            [ticker setTickerStrings:tickerStrings];
            [ticker setTickerSpeed:30.0f];
            [ticker start];
            [calloutMapAnnotationView.contentView addSubview:ticker];

 

相关文章:

  • 2021-06-21
  • 2021-10-23
  • 2022-01-22
  • 2022-12-23
  • 2021-08-05
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-01-10
  • 2021-06-21
  • 2022-12-23
  • 2022-02-26
相关资源
相似解决方案