Pergunta

I am developing an app in which there is a requirement in which there is a text in text view. I have to give mirror effect to that text view text. I am searching on Google but can't find any solution.

How can I solve it? Thanks in advance.

Foi útil?

Solução

I wrote a blog post awhile ago that uses a view's CAReplicatorLayer. It's designed for handling dynamics updates to a view with reflection. The post uses a UIWebView, but you could just use a UITextView instead.

Outras dicas

Add a UILabel right beneath the text field. Apply a scale transformation to mirror it. Scale the y axis by -1 and the x axis by 1. Then all you have to do is update the text in the label every time the text field changes.

Check out this Demo project. It has what you want.

Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top