lundi 29 juin 2015

UILabel inside a View scrolling being truncated

I am using a UILabel to scroll text inside a small view, this scrolls and then repeats after some time. What happens now, is the length of the text, becomes truncated, so instead of the full name showing, it shows xxxxxxxxxx then .. at the end, is there a way to extend it, so it shows the entire text without truncating?

-(void)text_1_Move_animetion
{
    text_1_lable.frame = CGRectMake(text_1_lable.frame.size.width, text_1_lable.frame.origin.y, text_1_lable.frame.size.width, text_1_lable.frame.size.height);

    [UIView animateWithDuration:8.0 animations:^{
        text_1_lable.frame = CGRectMake(-text_1_lable.frame.size.width, text_1_lable.frame.origin.y, text_1_lable.frame.size.width, text_1_lable.frame.size.height);
    }];
    [self performSelector:@selector(text_1_repet) withObject:self afterDelay:8.0];


}
-(void)text_1_repet
{
    text_1_lable.frame = CGRectMake(text_1_lable.frame.size.width, text_1_lable.frame.origin.y, text_1_lable.frame.size.width, text_1_lable.frame.size.height);


    [UIView animateWithDuration:8.0 animations:^{
        text_1_lable.frame = CGRectMake(-text_1_lable.frame.size.width, text_1_lable.frame.origin.y, text_1_lable.frame.size.width, text_1_lable.frame.size.height);
    }];


    [self performSelector:@selector(text_1_Move_animetion) withObject:self afterDelay:8.0];
}

If I set the linebreak within the .xib file to 'break' it does not truncate with a .. It shows a bit more, but then cuts off towards the end.

Aucun commentaire:

Enregistrer un commentaire