java.lang.IllegalArgumentException: You need to use a Theme.AppCompat theme (or descendant) with the
2017-03-07 15:24
1311 查看
java.lang.IllegalArgumentException: You need to use a Theme.AppCompat theme (or descendant) with the design library
我遇到这个错误是在fragment里应用了coordinatorLayout,xml inflate无效
查了好多这是最新的sdk的bug
解决办法:在style里写一个自定义的style,然后在加入这个fragment的Activty 添加theme
还有一种方法就是直接给fragment添加theme,在代码里直接添加
我遇到这个错误是在fragment里应用了coordinatorLayout,xml inflate无效
查了好多这是最新的sdk的bug
解决办法:在style里写一个自定义的style,然后在加入这个fragment的Activty 添加theme
<style name="AppTheme.NoActionBar"> <item name="windowActionBar">false</item> <item name="windowNoTitle">true</item> </style> <activity android:name="EventsDetailsActivity" android:theme="@style/AppTheme.NoActio>
还有一种方法就是直接给fragment添加theme,在代码里直接添加
final Context contextThemeWrapper = new ContextThemeWrapper(getActivity(), R.style.community_theme); // clone the inflater using the ContextThemeWrapper LayoutInflater localInflater = inflater.cloneInContext(contextThemeWrapper); View viewRoot = localInflater.inflate(R.layout.fragment_rank_landing, container, false);
相关文章推荐
- java.lang.IllegalArgumentException: You need to use a Theme.AppCompat theme (or descendant) with ...
- Java.lang.IllegalArgumentException: You need to use a Theme.AppCompat theme (or descendant) with the
- java.lang.IllegalStateException: You need to use a Theme.AppCompat theme (or descendant) with this a
- java.lang.IllegalStateException: You need to use a Theme.AppCompat theme (or descendant) with this a
- java.lang.IllegalStateException: You need to use a Theme.AppCompat theme (or descendant) with this
- java.lang.IllegalStateException: You need to use a theme.appcompat theme (or descendant) with this activity
- java.lang.IllegalStateException: You need to use a Theme.AppCompat theme (or descendant) with this a
- java.lang.IllegalStateException: You need to use a Theme.AppCompat theme (or descendant) with this a
- java.lang.IllegalStateException: You need to use a Theme.AppCompat theme (or descendant) with this a
- java.lang.IllegalStateException: You need to use a Theme.AppCompat theme (or descendant) with this a
- java.lang.IllegalStateException: You need to use a Theme.AppCompat theme (or descendant) with this a
- java.lang.IllegalStateException: You need to use a Theme.AppCompat theme (or descendant) with this a
- java.lang.IllegalStateException: You need to use a Theme.AppCompat theme (or descendant
- Caused by: java.lang.IllegalStateException: You need to use a Theme.AppCompat theme (or descendant)
- Caused by: java.lang.IllegalStateException: You need to use a Theme.AppCompat theme (or descendant)
- Caused by: java.lang.IllegalStateException: You need to use a Theme.AppCompat theme (or descendant)
- Caused by: java.lang.IllegalStateException: You need to use a Theme.AppCompat theme (or descendant)
- Android开发丶Caused by: java.lang.IllegalArgumentException: You need to use a Theme.AppCompat theme (or
- Caused by: java.lang.IllegalStateException: You need to use a Theme.AppCompat theme (or descendant)
- eclipse:java.lang.IllegalStateException: You need to use a Theme.AppCompat theme (or descendant) wit