我正在我的安卓项目中动态显示一些VectorDrawable图标。但是,我无法使用以下代码缩放java层中的图标:
VectorDrawable jDrawable = (VectorDrawable) getContext().getDrawable(nResourceID);
// resize the icon
jDrawable.setBounds(30, 30, 30, 30);
// set the icon in the button view
button.setCompoundDrawablesRelativeWithIntrinsicBounds(jDrawable,
我在我的安卓应用程序中对EditText进行了验证。该错误消息按预期弹出,但未显示默认错误图标。
if(users.getText().toString().isEmpty()){
errorNum++;
users.setError("Field can not be empty");
} else {
users.setError(null);
}
我也尝试了自定义图标,它不起作用。
users.setError("Field can not be empty",getDraw