AlertDialog does not show dividers on a list

前端 未结 2 981
庸人自扰
庸人自扰 2021-02-13 06:26

I have this class:

public class PageDetailInfoView extends FrameLayout {

//few constructors and methods

//method to show an AlertDialog with a list
private voi         


        
2条回答
  •  醉酒成梦
    2021-02-13 06:51

    It is probably because you are running your app on Android 5.0+ which has Material design.

    To get the "old" look, just construct your dialog with the Holo style:

    ContextThemeWrapper themedContext = new ContextThemeWrapper(getContext(), android.R.style.Theme_Holo_Light_Dialog_NoActionBar);
    AlertDialog.Builder builder = new AlertDialog.Builder(themedContext);
    // ... then create your dialog
    

    Although this might seem weird for some users (especially on Lollipop and Marshmallow, so I recommend looking into using custom views for your dialog.

提交回复
热议问题