让字符串滚动显示
目标效果:
样式代码:
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];