[ErrorLog] 遇到 Java.Lang.IllegalStateException: You need to use a Theme.AppCompat theme (or descendant) with this activity.

2016-07-28

遇到錯誤訊息 Java.Lang.IllegalStateException: You need to use a Theme.AppCompat theme (or descendant) with this activity. 怎麼解決呢?

sh112

解決方案 :  簡單的說 因為你啟動的Activity 繼承了 AppCompatActivity 她啟動必須要 AppCompat 的 Theme 這時候只需要再Activity 上加入 Theme = "@style/Theme.AppCompat"
sample:

[Activity(Label = "SliderTest2", MainLauncher = true, Icon = "@drawable/icon", Theme = "@style/Theme.AppCompat")]
public class MainActivity : AppCompatActivity, IOnTabReselectedListener, ViewPager.IOnPageChangeListener
{
  ....


當麻許的超技八 2014 | Donma Hsu Design.