Xamarin : Designer show error : you need to use a theme.appcompat theme (or descendant) with the design library

這個問題是出現在使用 Visual Studio 2017 Xamarin 建立 Android 單一檢視應用程式時發生的問題,主要原因應該 原因是這個專案預設使用了 appcompat 主題的 android.support.design.widget.CoordinatorLayout 框架,而預設主題無法解析這個框架導致錯誤 如果你在 Designer 的畫面上點擊 show error 就可以看到這個相關訊息 java.lang.IllegalArgumentException was throw you need to use a theme.appcompat theme (or descendant) with the design library 如果堅持使用 CoordinatorLayout 解決方式就是去更改 Designer 上的 主題(Theme),將它改為 Theme.AppCompat 樣式 就可以正常顯示了