Android AlertDialog全屏显示去除白色边框


使用styles.xml风格:
 
Style.xml代码 
<style name="FullScreenDialog" parent="android:style/Theme.Dialog"> 
    <item name="android:windowNoTitle">true</item> 
    <item name="android:windowFrame">@null</item> 
    <item name="android:windowIsFloating">true</item> 
    <item name="android:windowIsTranslucent">false</item> 
    <item name="android:background">@android:color/black</item> 
    <item name="android:windowBackground">@null</item> 
    <item name="android:backgroundDimEnabled">false</item> 
</style> 
使用AlertDialog的上层接口类:
 
Java代码 
Dialog reNameDialog = new Dialog(getContext(), R.style.FullScreenDialog); 
LayoutInflater mLayoutInflater = (LayoutInflater) getContext().getSystemService(Context.LAYOUT_INFLATER_SERVICE); 
View reNameView = mLayoutInflater.inflate(R.layout.audiorecord_rename, null); 
LayoutParams params = new LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT); 
reNameDialog.addContentView(reNameView, params); 
reNameDialog.show(); 

 


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM