Android Studio 报Integer types not allowed错误

Adelaide ·
更新时间:2024-09-21
· 934 次阅读

Android Studio 报错

Error:(25, 5) Integer types not allowed (at 'android:textSize' with value '12').

代码

<style name="HorizontalBtnLayout"> <item name="android:layout_height">match_parent</item> <item name="android:layout_width">0dp</item> <item name="android:layout_weight">1</item> <item name="android:textSize">12</item> </style>

分析:

1.是不是<style> </style>标签内不能使用android:textSize,系统有提示,说明可以的
2.根据报错Integer tyes is not allowed,考虑到是不是类型有问题,😝,改为12sp已ok
3,记得一定带单位

 <item name="android:textSize">12sp</item>

您可能感兴趣的文章:Android Studio 报错“app:processDebugResources"解决方法Android Studio启动报错Java 1.8 or later is required的解决方法Android Studio 报错failed to create jvm error code -4的解决方法



Android Studio studio NOT INTEGER types Android

需要 登录 后方可回复, 如果你还没有账号请 注册新账号