Search code examples
androidtextviewclip

Android clip upper part of text in TextView


I need to have two TextViews displaying same number, first of which should display upper half and second lower half in order to animate those parts differently. (See images below, there's an example with '8' digit).

http://img403.imageshack.us/img403/2461/bottomtop.png

While clipping bottom is perfectly simple (setting TextView's height is just enough), the second task I find very hard. The only solution I came up with till now is to wrap TextView into some layout and set it's y position to negative - it would be OK, but I need to care about optimization because there will be many digits animated in that way simultaneously.

Do any of you know how to achieve this in more effective way?


Solution

  • What about overlaying the top textview OVER the bottom textview (maybe with the white spacer as well?