2014-10-30 95 views
0

我已創建自定義樣式的複選框變化選擇框顏色AlertDialog

<style name="CheckBoxtpi" parent="android:Widget.CompoundButton.CheckBox"> 
    <item name="android:button">@drawable/tpi_btn_check_holo_light</item> 
</style> 

enter image description here

並將其應用到我的主題,它的工作原理很漂亮,但在警告對話框仍然旗霍洛藍色所有複選框。 enter image description here 我該如何改變這種情況?

+0

看到這個鏈接http://stackoverflow.com/questions/15710543/custom-style-on-dialog-複選框 – duggu 2014-10-30 12:25:41

回答

0

你可以做兩種選擇;

  1. getApplicationContext()改變你的背景或其他任何明確MyActivity.this,(無論您的活動名稱是),當你建立你的對話框。 這可能會解決問題。

  2. 您可以創建該對話框的自定義佈局,並把它

     dialog.setContentView(R.layout.custom_dialog);