android - Is there a similar method to "bringToFront()" on Linear Layout? -
well, i'm making game uses class extends surfaceview
represent game screen, works buttons, i'm defining "buttons panel" on xml , adding "gameview" linearlayout, contains stuff, programatically , bringing "buttons panel" front, this:
protected void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.activity_main); linearlayout rl1 = (linearlayout)findviewbyid(r.id.rl1); rl1.addview(new gameview(this)); squarelayout sq1 = (squarelayout)findviewbyid(r.id.square); //the control buttons in custom layout called "squarelayout" sq1.bringtofront(); }
the problem here want layout contains game buttons(the squarelayout) fill half of height of relativelayout(the activity set landscape), morphing relativelayout vertical linearlayout, adding squarelayout, , setting both weight's properties 1, , it's this:
the problem "bringtofront();" method not work on linearlayout, can't modify z of buttons panel after adding gameview, question if there's way make buttons panel on image on relativelayout or similar method "bringtofront()" works on linearlayout.
try invoke method bringchildtofront(view)
on linearlayout http://developer.android.com/reference/android/view/viewgroup.html#bringchildtofront(android.view.view). parameter view want display on top of siblings.
Comments
Post a Comment