2013-02-26 25 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中没有任何更改。

回答