Ach*_*hin 2 java user-interface android android-layout
我有TextView并且我想以编程方式绘制圆角矩形形状,我想将该形状设置为TextView? 我想动态改变它的颜色,我已经发布了图片?

public static void makeRoundCorner(int bgcolor,int radius,View v,int strokeWidth,int strokeColor)
{
GradientDrawable gdDefault = new GradientDrawable();
gdDefault.setColor(bgcolor);
gdDefault.setCornerRadius(radius);
gdDefault.setStroke(strokeWidth, strokeColor);
v.setBackgroundDrawable(gdDefault);
}
Run Code Online (Sandbox Code Playgroud)
这里 View v = 你的 textview 或按钮或任何东西。
| 归档时间: |
|
| 查看次数: |
4435 次 |
| 最近记录: |