Method of realizing text reflection effect by Android programming

This paper describes the method of text reflection effect by Android programming. Share with you for your reference, as follows:

All our views inherit from the view class. There is a method in the view class called OnDraw (). That is, the interfaces we see are drawn, so we can override the OnDraw () method.

Now that we know this, it's easy to do. Another difficulty is that our reflection is also drawn. Where do we get the original picture? Children's shoes familiar with view know cache. Yes, we get the original picture through cache.

Put the source code., Thank you and look forward to it. This is just a demo, not perfect. Ha, the layout needs to be adjusted. Or when I am free to package again, I can adjust it directly from the layout file.

Add the following code to the layout file

Class codes are as follows:

More readers interested in Android related content can view the special topics of this site: summary of Android graphics and image processing skills, introduction and advanced tutorial of Android development, summary of Android debugging skills and common problem solving methods, summary of Android basic component usage, summary of Android view skills, summary of Android layout skills, and Android control usage summary

I hope this article will help you in Android programming.

The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
分享
二维码
< <上一篇
下一篇>>