0

I have a Relative layout with 5 buttons on the bottom. When you click and hold on one of these buttons it makes another invisible relative layout visible which overlays the whole screen. I want the button that was clicked to make the overlay visible to remain visible with the overlaying relative layout. How can i do this?

I have tried using button.BringToFront along with invalidate, but that did not work. The button was still behind the overlay.

Nick H
  • 8,897
  • 9
  • 41
  • 64
  • Separate your layouts. The buttons on a layout on the bottom and just over them the swapping layouts. – Phantômaxx Apr 27 '15 at 14:10
  • 1
    You start doing it by ordering views in the XML file, lower in the XML file means higher in the Z axis, then, you can move your button to the from programmatically with btn.bringToFront(); You will find this useful: http://stackoverflow.com/questions/2614393/defining-z-order-of-views-of-relativelayout-in-android – Josh Apr 27 '15 at 14:15
  • Thanks for the comments, they were very helpful. Could the down voters care to comment? – Nick H Apr 28 '15 at 13:13

1 Answers1

0

I ended up moving the overlay in front of the button that I wanted to remain visible. The trick was just XML organization.

Nick H
  • 8,897
  • 9
  • 41
  • 64