Search code examples
androidcanvasviewandroid-actionbarz-index

Placing/Overlapping (z-index) a view above actionbar tabs


I have a View that draws something outside the Fragment containing it and I configured it to draw the content outside it using this.

The problem is that it works everywhere but on the ActionBar and ActionBar Tabs.

mActionBar.addTab(
    mActionBar.newTab()
        .setCustomView(t));

I am using appCompat and adding tabs this way:

I added android:clipChildren="false" to all the parent Views, but it doesn't work just for ActionBar and ActionBar tabs.

The desired view:

enter image description here But the result is this:

enter image description here


Solution

  • I finally Removed the tabBar and replaced it with simple buttons to switch between tabs and placed it before CustomLayout in xml to be drawn before it.

    <LinearLayout
        ....
        // tabs layout />
    
    <CustomLayout
    
    ....
    />