LinearLayout layout = (LinearLayout) findViewById(R.id.layout); Drawable drawable = getResources().getDrawable(R.drawable.bg); BitmapDrawable bitmapDrawable = (BitmapDrawable) drawable; Bitmap bitmap = bitmapDrawable.getBitmap(); BitmapDrawable bbb = new BitmapDrawable(toRoundCorner(bitmap, 30)); layout.setBackgroundDrawable(bbb); //ImageView imageView = (ImageView) findViewById(R.id.imgShow); //imageView.setImageBitmap(MyActivity.getRoundedCornerBitmap(bitmap)); //imageView.setImageBitmap(MyActivity.toRoundCorner(bitmap, 20));
在Java代码里设置控件圆角
最新推荐文章于 2022-12-14 17:09:28 发布
