Search code examples
androidkotlinandroid-activityfragmentarcore

ArFragment hides some views on Acitivity if add it programatically


I have activity, where is located 2 fabs and text. I need to add ArFragment on full screen. If I add this fragment using xml, 2 fabs and text is shown. But if I use supportFragmentManager.beginTransaction().add(R.id.ontainer, ArFragment()).commit(), after it is showing only 2 fabs and text disappears. How can I fix it, because I need to use programmatically way.

Here you can see textView enter image description here


Solution

  • I use ViewCompat.setTranslationZ(view, 1.0f) for fixing problem