UITextView - rolagem horizontal?
Como posso criar umhorizontal rolagem UITextView?
Quando defino meu texto programaticamente, ele adiciona quebras de linha automáticas, portanto, só posso rolar verticalmente ...
titleView.text = @"this is a very long text. this is a very long text. this is a very long text. this is a very long text. this is a very long text.";
Obrigado por suas respostas.
EDIT: Até agora eu tentei isso:
UIScrollview *yourScrollview = [[UIScrollView alloc] initWithFrame:CGRectMake(0 ,0 , self.view.frame.size.width, 50)];
CGFloat textLength = [titleView.text sizeWithFont:titleView.font constrainedToSize:CGSizeMake(9999, 50) lineBreakMode:NSLineBreakByWordWrapping].width;
yourScrollview.contentSize = CGSizeMake(textLength + 200, 500); //or some value you like, you may have to try this out a few times
titleView.frame = CGRectMake(titleView.frame.origin.x, titleView.frame.origin.y, textLength, titleView.frame.size.height);
[yourScrollview addSubview: titleView];
NSLog(@"%f", textLength);
mas recebi: 'Ameaça 1: sinal SIGABRT'