Dialog skinning with AppCompat-v7 22 results in ugly shadows on api < 21

前端 未结 5 1460
深忆病人
深忆病人 2020-12-29 22:31

I\'m using AppCompat to write a material design styled app. Since AppCompat does not affect dialogs, I\'m skinning the dialogs as such:

styles.xml:



        
5条回答
  •  不知归路
    2020-12-29 22:56

    In case anyone is still looking for a simple and effective solution, just add this line to your "alertDialog" style:

    @android:color/transparent
    

    P.S. changing this property also affects PreferenceFragment's dialogs on API >= 21, so make sure you are using different styles: with transparent bg for API < 21, and without any changes for API >= 21

提交回复
热议问题