android - Changing the ActionBars opacity due to the Activities view size -
i have activity sherlockmapfragment supportmapfragment. in display map markers example gas stations. want ui looks bit google maps android transparent actionbar can see map through actionbar. assure behavior call requestwindowfeature in activity before call setcontentview().
this.requestwindowfeature(window.feature_action_bar_overlay); setcontentview(layout.activitylayout);
important me actionbar (i use sherlock) transparent still has actions (optionsmenu) visible user can click actions on transparent actionbar - google maps android.
so far works , looks good. next thing want show markers on map in list aswell user can choose suits better him. different presentation same data. listview element in fragmentlayout.xml inflate , fill data.
now problem comes: did call requestwindowfeature tell system use space behind actionbar, inflate listview same size , first element of list behind actionbar instead of below actionbar.
it perfect if instance reset behavior view begins behind or below actionbar depending on need.
what did try: 1) of course tried call requestwindowfeature after inflating listview ends in runtimeexception because can call before setcontentview()
2) tried set flag via setfeatureint() , invalidating within fragment follows:
getactivity().getwindow().setfeatureint( window.feature_action_bar_overlay), r.layout.activitylayout); super.oncreate(null); getactivity().invalidateoptionsmenu(); viewgroup vg = (viewgroup) getactivity().findviewbyid(r.layout.activitylayout); vg.invalidate(); vg.requestlayout(); vg.postinvalidate();
it great if me. if need additional information please contact me.
cheers emanuel
Comments
Post a Comment