Drawing dashed line on Android Programmatically
-
I want to draw horizontal dashed lines programmatically between programmatically generated TextViews. I found this code on Internet:
Paint fgPaintSel = new Paint(); fgPaintSel.setARGB(255, 0, 0, 0); fgPaintSel.setStyle(Paint.Style.STROKE); fgPaintSel.setPathEffect(new DashPathEffect(new float\[\]{5, 10}, 0));
I just copied and pasted this code but nothing happened. What should I do to draw a dashed line? Thanks.
-
I want to draw horizontal dashed lines programmatically between programmatically generated TextViews. I found this code on Internet:
Paint fgPaintSel = new Paint(); fgPaintSel.setARGB(255, 0, 0, 0); fgPaintSel.setStyle(Paint.Style.STROKE); fgPaintSel.setPathEffect(new DashPathEffect(new float\[\]{5, 10}, 0));
I just copied and pasted this code but nothing happened. What should I do to draw a dashed line? Thanks.
jasonalien wrote:
I just copied and pasted this code...
Where to?
"One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
"You can easily judge the character of a man by how he treats those who can do nothing for him." - James D. Miles
-
I want to draw horizontal dashed lines programmatically between programmatically generated TextViews. I found this code on Internet:
Paint fgPaintSel = new Paint(); fgPaintSel.setARGB(255, 0, 0, 0); fgPaintSel.setStyle(Paint.Style.STROKE); fgPaintSel.setPathEffect(new DashPathEffect(new float\[\]{5, 10}, 0));
I just copied and pasted this code but nothing happened. What should I do to draw a dashed line? Thanks.