TextView tv = new TextView(this);
tv.setTextColor(Color.WHITE);
tv.setText("text text text");
tv.setTextSize(25);
tv.setShadowLayer(1.5f, -1, 1, Color.LTGRAY); //그림자 효과
LinearLayout.LayoutParams lp
= new LinearLayout.LayoutParams(LinearLayout.LayoutParams.WRAP_CONTENT, LinearLayout.LayoutParams.WRAP_CONTENT);
lp.topMargin = 20; //마진은 LayoutParams
mainLayout.addView(tv, lp);
그림자 효과
public void setShadowLayer (float radius, float dx, float dy, int color)
dx, dy : 그림자의 위치
This draws a shadow layer below the main layer, with the specified offset and color, and blur radius. If radius is 0, then the shadow layer is removed.