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:
But the result is this:
It's not easy to help you without the complete source code; anyway I can suggest you an alternative approach which may suit your case.
If you are creating a custom floating item (maybe used for a tutorial or an hint), you should avoid to alter the base views hierarchy and prefer a pure overlay solution.
The PopupWindow is exactly what you need:
A popup window that can be used to display an arbitrary view.
Since the PopupWindow
acts at Activity
level, it should overlay everything in your current Activity
.
The popup window is a floating container that appears on top of the current activity.
You can find a simple example here.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With