Sketchware 自定义块属性

问题描述 投票:0回答:0

properties

代码:

MGerative 的属性

android.graphics.drawable.GradientDrawable properties = new android.graphics.drawable.GradientDrawable();

彩色描边阴影圆形

properties.setColor(Color.parseColor(_color));

properties.setCornerRadii(new float[]{(int) _r1,(int) _r1,(int) _r2,(int) _r2,(int) _r4,(int) _r4,(int) _r3,(int) _r3});

properties.setStroke((int) _stroke, Color.parseColor(_colour));
_view.setElevation((float) _shadow);

_view.setBackground(properties);

尺码

LinearLayout.LayoutParams size = new LinearLayout.LayoutParams((int)(getResources().getDisplayMetrics().density*_width), (int)(getResources().getDisplayMetrics().density*_height));

_view.setLayoutParams(size);

完成!

test

android size rounding sketchware
© www.soinside.com 2019 - 2024. All rights reserved.