註冊 登錄
Android 台灣中文網 返回首頁

鋼索上的大頭人蔘 https://apk.tw/?66179 [收藏] [複製] [分享] [RSS] 健忘如我,需要的是可以放筆記的地方…

日誌

android Dialog 的樣式設定

已有 847 次閱讀2015-8-14 16:03 |個人分類:筆記筆記筆記| android

AlertDialog.Builder dialog = new AlertDialog.Builder(MainActivity.this, AlertDialog.THEME_TRADITIONAL);  //傳統主題

AlertDialog.Builder dialog = new AlertDialog.Builder(MainActivity.this, AlertDialog.THEME_HOLO_DARK);  //HOLO DARK 主題

AlertDialog.Builder dialog = new AlertDialog.Builder(MainActivity.this, AlertDialog.THEME_HOLO_LIGHT);  //HOLO LIGHT 主題

AlertDialog.Builder dialog = new AlertDialog.Builder(MainActivity.this, THEME_DEVICE_DEFAULT_DARK);  //預設深色主題

AlertDialog.Builder dialog = new AlertDialog.Builder(MainActivity.this, AlertDialog.THEME_DEVICE_DEFAULT_LIGHT);  //預設淺色主題

//自定義樣式
View myDialogLayout = getActivity().getLayoutInflater().inflate(R.layout.mydialog, null);
AlertDialog.Builder dialog = new AlertDialog.Builder(MainActivity.this, AlertDialog.THEME_DEVICE_DEFAULT_DARK);
final AlertDialog dialog = builder.create();
dialog.setView(myDialogLayout);

今天客戶反應手機的 Dialog 在4.3測試是透明的???在5.0又正常,
看來只有直接給他個固定樣式才是最佳解 XD

路過

雞蛋

鮮花

握手

雷人

評論 (0 個評論)

facelist

您需要登錄後才可以評論 登錄 | 註冊