Android Crosshair dotted/dashed lines



As per title, is it possible to customize the lines of the crosshair to appear dotted or dashed rather than continuous?



Thanks for getting in touch.

ShinobiCharts for Android offers a listener convenience method which allows you to intervene as the crosshair is about to be drawn and make changes. For reference the api docs for this method can be found here:,,, float, float, float,

Part of the solution then is to implement this method to draw your own crosshair circle and lines, modified to your requirements (in this case, with dashed lines). 

Unfortunately, a bug exists in Android which means that it is not as simple as using the Paint object’s own methods to tell the line to draw with a dashed pattern (for example, paint.setPathEffect(new DashPathEffect(new float[] {10,20}, 0))). Please see details of this bug here:

Specifically this affects ShinobiCharts for Android as our use of OpenGL means that the HardwareAccelerated option must be set to true.

I believe a solution to your problem is to use View objects, to draw your lines in a dashed pattern. If you look at this blog post below, you will see an example of how to do this, albeit in a different context. 

(Please search for ‘createDottedLineView’.

I hope that you find this useful, please post back if you have any further questions.

Thanks and kind regards,