我正在尝试使用从Android操作栏样式生成器生成的代码。在我的应用程序中创建和标签。但不幸的是停止错误正在显示..可能是一些主题问题..我还添加了:
清单中的android:theme="@style/Theme.Example"
。
请帮帮我。我是android的初学者。
logcat的:
java.lang.RuntimeException: Unable to start activity ComponentInfo{com.example.priyankagupta.tabbing/com.example.priyankagupta.tabbing.MainActivity}:
java.lang.IllegalStateException: You need to use a Theme.AppCompat theme (or descendant) with this activity. at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2338)
答案 0 :(得分:0)
删除android
标记,如:
<item name="actionBarTabTextStyle">@style/MyTheme.ActionBar.TabText</item>
因为您使用的是支持库。
并尝试使用parent
MyTheme.ActionBar.TabText
作为:
parent="Widget.AppCompat.Base.ActionBar.TabText"