Home > other >  About unity5.5 android add background opaque handle after the view, for help
About unity5.5 android add background opaque handle after the view, for help

Time:09-19

I need to add an android to mUnityPlayer in android Layout, code roughly as follows, now the question is as follows

, according to the normal pictures with unity4.7 after adding the FrameLayout background is transparent
But I use unity5.5 addView after image background is always white, can't modify the

Now I need to use the android everywhere mUnityPlayer dynamically add a andor create view, need to view the background transparent, you can see the mUnityPlayer behind other contents, excuse me, how to implement, because android compatibility issues, needs unity5.5 for




MUnityPlayer=new UnityPlayer (this);
The 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.d rawable. App_icon);
ImageView. SetScaleType (imageView. ScaleType. FIT_XY);
ImageView. SetBackgroundColor (Color. TRANSPARENT);
//mUnityPlayer. AddViewToPlayer (imageView, true);

MUnityPlayer. AddView (imageView);

Button. SetBackgroundResource (R.d rawable. App_icon);

CodePudding user response:

The building Lord solved? I met a similar problem

CodePudding user response:

The solution? The original poster

CodePudding user response:

Solved yet? I also encountered the same problem, let a person very afflictive,
  • Related