0

Im using this tutorial to create a custom view : LINK

Initially the Canvas was not drawing all the parts, but after turning off hardware acceleration, all the parts are drawn. I set this setLayerType(View.LAYER_TYPE_SOFTWARE,null); in the constructor of my custom view ( tried setting in the manifest too).

But the Canvas.drawText() (For the degree celsius values ) is only drawing "0" instead of the values and is not ordered. My problem is exactly same as in here : Link to the image . I use the same method as in this link.

This is working fine on Sony Experia M (4.1.2) , problem is occurring on Samsung Galaxy S5 (4.4.2)

Does anyone know why this problem is occurring? Thanks.

Community
  • 1
  • 1
quad
  • 872
  • 3
  • 17
  • 37
  • are you trying to implement the exact same custom view as in the tutorial you're following (the one from the link)? Are you changing the value of the text that you want to draw from 0 to something during the view's operation? Maybe you could attach some of your code? – Bartek Lipinski Dec 21 '14 at 17:24

1 Answers1

0

Just add
scalePaint.setLinearText(true);
in initDrawingTools()

Refer link: Android 4.2 on Nexus 7: canvas.drawText() not working correctly

Community
  • 1
  • 1
Spark
  • 1