Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

How to use Render Over Native UI?

Discussion in 'Android' started by ink_, Jan 15, 2021.

  1. ink_

    ink_

    Joined:
    Aug 5, 2020
    Posts:
    5
    How to use Render Over Native UI?
    It do not work.

    Unity version:2019.4.18f1
    Android Platform
    And java code:
    FrameLayout frameLayout = new FrameLayout(this);
    FrameLayout.LayoutParams lp = new FrameLayout.LayoutParams(1920, 1080); frameLayout.setLayoutParams(lp);
    setContentView(frameLayout);
    try {
    ImageView camBigMask = new ImageView(this); camBigMask.setImageBitmap(BitmapFactory.decodeStream(this.getAssets().open("image/B_bg_2.jpg"))); frameLayout.addView(camBigMask);
    }
    catch (Exception e) { }
    mUnityPlayer = new UnityPlayer(this, this);
    mUnityPlayer.setX(100);
    mUnityPlayer.setY(100);
    frameLayout.addView(mUnityPlayer);
    mUnityPlayer.requestFocus();
     
  2. ink_

    ink_

    Joined:
    Aug 5, 2020
    Posts:
    5
  3. ink_

    ink_

    Joined:
    Aug 5, 2020
    Posts:
    5
    Is there something I'm missing?
     
  4. ink_

    ink_

    Joined:
    Aug 5, 2020
    Posts:
    5
    Can someone help me? It's urgent.
     
  5. rjonaitis

    rjonaitis

    Unity Technologies

    Joined:
    Jan 5, 2017
    Posts:
    115
    Looks like you are doing something custom with the app, the app style needs to have translucent enabled to render over native UI. Most likely you need to add <item name="android:windowIsTranslucent">true</item> in your app's styles.xml
     
  6. ink_

    ink_

    Joined:
    Aug 5, 2020
    Posts:
    5
    I did not modify the file.
    I think Unity has bugs here,maybe wrong in the configuration.
    you can try,create the new project, just change the my screenshot.
     
  7. xiaoxue123

    xiaoxue123

    Joined:
    Jul 19, 2017
    Posts:
    1
    Urgent urgent...If I want to implement Unity rendering in a Native interface on IOS, do I need to do anything else in xcode other than check Render Over Native UI(I only do that,but it is not work)