支持库可以提供与旧版本的Android兼容的DialogFragment。继续使用片段对话框,因为您所要求的是非常特定的内容(3个下拉菜单和一个编辑文本)。只需右键单击您的项目,然后按“Android工具”-->“添加支持库”确保在使用对话框时导入。
import android.support.v4.app.DialogFragment;
Else you'll end up using the dialog without the support :P. You will have more flexibility with the dialog fragment and the power to use the view you see fit (even a layout made by yourself) without much effort.
Dialog Fragment
Pros:
- Capable of adding any view
- Easy to edit
- Can be adapted to tablets or cellphones in landscape or portrait just by modifying the layout
- Can dedicate a whole new class just to modify it your way
Cons:
- Cosumes more memory the more complex is your view
- Harder to code
Popup Window:
Pros:
- Simpler
- Easier to code
- It's more standard so it'll be harder for the user to be confused with it
Cons:
- Simpler, which means less control over it
- Limited to a few templates
These are just from the top of my mind and from my experience, but you should read the documentation.
http://developer.android.com/reference/android/widget/PopupWindow.html
http://developer.android.com/reference/android/app/DialogFragment.html