让字符串滚动显示

目标效果:

样式代码:

            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];

 

posted @ 2013-02-28 09:42  ygm900  阅读(530)  评论(0编辑  收藏  举报