android.view.InflateException: <include /> can only be used inside of a ViewGroup

本文详细解析了Android开发中将<include/>标签放置于控件内部导致的错误原因,帮助开发者理解并避免此类常见问题。
android 中的<include />标签出现这样的错误是因为你的<include />放置到了某个控件里面去了
根据我发的这个方法,解决这个报错// android.view.InflateException: Binary XML file line #17 in com.google.android.apps.wallpaper:layout/abc_expanded_menu_layout: Failed to resolve attribute at index 0: TypedValue{t=0x2/d=0x7f04045c a=-1}, theme={InheritanceMap=[id=0x7f140367com.google.android.apps.wallpaper:style/Theme.AppCompat.CompactMenu, id=0x7f14004fcom.google.android.apps.wallpaper:style/Base.Theme.AppCompat.CompactMenu], Themes=[com.google.android.apps.wallpaper:style/Theme.AppCompat.CompactMenu, forced, com.google.android.apps.wallpaper:style/WallpaperTheme, forced, com.google.android.apps.wallpaper:style/CustomizationTheme.NoActionBar, forced, com.google.android.apps.wallpaper:style/Theme.AppCompat.Empty, forced, android:style/Theme.DeviceDefault.Light.DarkActionBar, forced]} // Caused by: java.lang.UnsupportedOperationException: Failed to resolve attribute at index 0: TypedValue{t=0x2/d=0x7f04045c a=-1}, theme={InheritanceMap=[id=0x7f140367com.google.android.apps.wallpaper:style/Theme.AppCompat.CompactMenu, id=0x7f14004fcom.google.android.apps.wallpaper:style/Base.Theme.AppCompat.CompactMenu], Themes=[com.google.android.apps.wallpaper:style/Theme.AppCompat.CompactMenu, forced, com.google.android.apps.wallpaper:style/WallpaperTheme, forced, com.google.android.apps.wallpaper:style/CustomizationTheme.NoActionBar, forced, com.google.android.apps.wallpaper:style/Theme.AppCompat.Empty, forced, android:style/Theme.DeviceDefault.Light.DarkActionBar, forced]} // at android.content.res.TypedArray.getLayoutDimension(TypedArray.java:842) // at android.view.ViewGroup$LayoutParams.setBaseAttributes(ViewGroup.java:8426) // at android.view.ViewGroup$MarginLayoutParams.<init>(ViewGroup.java:8624) // at android.widget.FrameLayout$LayoutParams.<init>(FrameLayout.java:452) // at android.widget.FrameLayout.generateLayoutParams(FrameLayout.java:380)
最新发布
12-27
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
红包 添加红包
表情包 插入表情
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值