我必须在较小的设备 (nexus 4) 上将一些内容显示为全屏 Activity ,在中型设备 (nexus 7) 上显示为 float 对话框,在较大的设备 (nexus 10) 上显示为两个 Pane View 的 fragment 之一).满足所有三种屏幕尺寸的最佳方式是什么?
最佳答案
最好的方法可能是将其实现为 DialogFragment。您应该在 OnCreateView
中扩充布局并让 OnCreateDialog
返回 null。
然后您可以将 is 用作 Activity 中的常规 fragment ,用作中型设备的对话框和大型设备的嵌套 fragment 。
关于android - DialogFragment 与 Activity ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/24509598/