How are you supposed to use a ShapeDrawable with a PathShape to draw a line on a custom View?
问题 I am attempting to draw a line in a custom View . Here I've created a simple Path with just a single segment, created a PathShape from that, and finally stuck that into a ShapeDrawable with the intention of using that to draw on the Canvas inside onDraw() . However, this does not work. See my example, here. package com.example.test; import android.content.Context; import android.graphics.Canvas; import android.graphics.Color; import android.graphics.Paint; import android.graphics.Path; import