2013-02-26 24 views
1

我使用這個代碼在網絡錯誤顯示AlertDialog:AlertDialog看起來很怪的Android /單聲道

var builder = new AlertDialog.Builder(this); 
builder.SetMessage(error); 

builder.SetCancelable(false); 
builder.SetPositiveButton("OK", delegate { }); 
builder.Show(); 

但是,它看起來像這樣:

enter image description here

問題:

  1. 當前視圖不顯示d在alertdialog後面,它只是白色的。
  2. 它對齊頂部,而不是中心
  3. 主題或字體顏色錯誤,使文本難以閱讀。

我使用Theme.DeviceDefault.Light爲主題的活動:

[Activity (Label = "xxx", Theme = "@style/MyAppTheme", MainLauncher = true)] 

...

<?xml version="1.0" encoding="utf-8"?> 
<resources> 
    <style name="MyAppTheme" parent="@android:style/Theme.DeviceDefault.Light"> 
    </style> 
</resources> 

如何解決這一問題?試圖插入MyAppTheme作爲AlertDialog.Builder(this, Resource.Style.MyAppTheme)的第二個參數,但在UI中沒有任何更改。

回答