iapp学习

iApp-v3 控件圆角

2019-07-27  本文已影响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")

上一篇 下一篇

猜你喜欢

热点阅读