美文网首页iapp学习
iApp-v3 控件圆角

iApp-v3 控件圆角

作者: 明日未期 | 来源:发表于2019-07-27 15:40 被阅读0次

新建set.mjava

import android.app.*;
import android.content.res.*;
import android.graphics.*;
import android.os.*;


public static void setBackground(Activity activity, int id, int yja, int yjb, int yjc, int yjd, String color)
{
  try
  {
     android.graphics.drawable.GradientDrawable shape = new android.graphics.drawable.GradientDrawable();
     shape.setShape(android.graphics.drawable.GradientDrawable.RECTANGLE);
     shape.setCornerRadii(new float[] { yja, yja, yjb, yjb, yjc, yjc, yjd, yjd });
     shape.setColor(Color.parseColor(color));
     shape.setStroke(0, Color.parseColor("#ffffff"));
     activity.findViewById(id).setBackgroundDrawable(shape);
  }
  catch (Exception e){}
}

iyu调用
call(null,"mjava","set.setBackground",activity,8,40,40,0,0,"#2196f3")

相关文章

网友评论

    本文标题:iApp-v3 控件圆角

    本文链接:https://www.haomeiwen.com/subject/abjerctx.html