I want to create a TextView with the text mirrored vertically.
I tried this code, but it doesn't show anything...
Does anyone have an idea?
Using java Syntax Highlighting
- /** Called when the activity is first created. */
- @Override
- public void onCreate(Bundle savedInstanceState) {
- super.onCreate(savedInstanceState);
- setContentView(R.layout.main);
- rl = (RelativeLayout) findViewById(R.id.Rellayout);
- MirrorView speed = new MirrorView(getBaseContext());
- speed.setText("Testtest");
- rl.addView(speed);
- }
- private class MirrorView extends TextView {
- public MirrorView(Context context) {
- super(context);
- // TODO Auto-generated constructor stub
- }
- @Override
- protected void onDraw(Canvas canvas) {
- canvas.scale((float) -1.0f, (float) 1.0f, (float) (canvas
- .getWidth() / 2), (float) (canvas.getHeight() / 2));
- super.onDraw(canvas);
- }
- }
Parsed in 0.034 seconds, using GeSHi 1.0.8.4

