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