I have an XML layout with some custom tabs, a header and ProgressBar( main.xml). I want to add another XML layout ( home.xml) to the layout main.xml, since I want to save main.xmlreusable activity for other layouts and just add things to it as needed.
home.xmlcontains a ScrollViewand a TextView. I am currently using my activity LayoutInflatorto add home.xmlto main.xml:
LayoutInflater inflater = (LayoutInflater)getSystemService(Context.LAYOUT_INFLATER_SERVICE);
inflater.inflate(R.layout.home, rootLayout);
rootLayoutis the root location main.xmland isRelativeLayout
Problem: after bloating R.layout.homein, rootLayoutit seems that what ProgressBaris contained in rootLayoutis hidden under the contenthome.xml
Is there a way to let certain views (via XML) float over other views when the layout is designed this way?
If not, am I forced to use methods such as progressBar.bringToFront()to raise the target views at the top?
What alternatives do I have in z-order representations when some layouts are built using inflation?
edit: the method bringToFront()does not seem to fulfill what I expect - I find it in one of my views Buttonand it still looks ordered below all the other views (which were overpriced) and remains unclickable
source
share