Android Dialog 系統樣式講解及透明背景


 
Android <wbr>Dialog <wbr>系統樣式講解及透明背景 Android <wbr>Dialog <wbr>系統樣式講解及透明背景AlertDialog.Builder builder = new AlertDialog.Builder(DialogActivity.this,AlertDialog.THEME_TRADITIONAL);//傳統主題
 
Android <wbr>Dialog <wbr>系統樣式講解及透明背景

AlertDialog.Builder builder = new AlertDialog.Builder(DialogActivity.this,AlertDialog.THEME_HOLO_DARK);//使用深色背景 主題
 
Android <wbr>Dialog <wbr>系統樣式講解及透明背景
 
 
AlertDialog.Builder builder = new AlertDialog.Builder(DialogActivity.this,AlertDialog.THEME_HOLO_LIGHT);//使用淺色背景 主題

Android <wbr>Dialog <wbr>系統樣式講解及透明背景
 
 
AlertDialog.Builder builder = new AlertDialog.Builder(DialogActivity.this,AlertDialog.THEME_DEVICE_DEFAULT_DARK);//使用默認設備 深色主題
 
Android <wbr>Dialog <wbr>系統樣式講解及透明背景
 
AlertDialog.Builder builder = new AlertDialog.Builder(DialogActivity.this,AlertDialog.THEME_DEVICE_DEFAULT_LIGHT);//使用默認設備 淺色主題
 
Android <wbr>Dialog <wbr>系統樣式講解及透明背景

//自定義布局 
View layout = getActivity().getLayoutInflater().inflate(R.layout.mydialog,null);
AlertDialog.Builder dialog = new AlertDialog.Builder(DialogActivity.this,AlertDialog.THEME_DEVICE_DEFAULT_DARK);
final AlertDialog dialog = builder.create();
dialog.setView(layout);
//透明
Window window = dialog.getWindow(); 
WindowManager.LayoutParams lp = window.getAttributes();
lp.alpha = 0.9f;
window.setAttributes(lp);
。。。
dialog.show();
 
Android <wbr>Dialog <wbr>系統樣式講解及透明背景


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM