我要画一条虚线。我现在用这个来画实线:
LinearLayout divider = new LinearLayout( this );
LinearLayout.LayoutParams params = new LinearLayout.LayoutParams( LinearLayout.LayoutParams.FILL_PARENT, 2 );
divider.setLayoutParams( params );
divider.setBackgroundColor( getResources().getColor( R.color.grey ) );
我需要这样的东西,但不是实心的,而是虚线的。我想避免在透明布局和固体布局之间交替制作数百个布局。