关于unity5.5android添加view后背景不透明的处理,求救
我需要在android里给 mUnityPlayer 添加一个android的Layout,代码大概如下,现在的问题如下
用unity4.7添加后图片正常显示,图片背景的FrameLayout背景是透明的
但是我用unity5.5的话,addView后图片背景始终是白色的,无法修改
我现在需要用在到处android的mUnityPlayer动态添加一个andor创建的view,需要view背景透明,可以看到背后的mUnityPlayer的其他内容,请问如何实现,因为android兼容性问题,需要unity5.5实现
mUnityPlayer = new UnityPlayer(this);
setContentView(mUnityPlayer);
mUnityPlayer.requestFocus();
final ImageView imageView = new ImageView(getBaseContext());
final FrameLayout.LayoutParams params = new FrameLayout.LayoutParams(FrameLayout.LayoutParams.FILL_PARENT, FrameLayout.LayoutParams.FILL_PARENT);
params.topMargin = 0;
params.gravity = Gravity.TOP | Gravity.CENTER_HORIZONTAL;
imageView.setImageResource(R.drawable.app_icon);
imageView.setScaleType(ImageView.ScaleType.FIT_XY);
imageView.setBackgroundColor(Color.TRANSPARENT);
//mUnityPlayer.addViewToPlayer(imageView, true);
mUnityPlayer.addView(imageView);
button.setBackgroundResource(R.drawable.app_icon);