简体   繁体   中英

Full Screen Fragment and Non Full Screen Fragment on Same Activity

I have two fragments, A and B.

I want A to show on top of B (this is working fine, no problem here using a relative layout).

I also want to be able to slide Fragment A down to reveal fragment B. The kicker is that I want fragment A to show on top of the action bar. I'm using the new ActionBar compat library from Google.

How do I do this? I essentially want the opposite of action bar overlay (underlay?).

Turns out I should have been thinking of this as a DialogFragment instead.

I turned Fragment A into a DialogFragment and added this to it's class:

@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setStyle(STYLE_NO_FRAME, android.R.style.Theme_Holo_Light);
}

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM