溫馨提示×

溫馨提示×

您好,登錄后才能下訂單哦!

密碼登錄×
登錄注冊×
其他方式登錄
點擊 登錄注冊 即表示同意《億速云用戶服務(wù)條款》

Android Studio報Integer types not allowed錯誤怎么辦

發(fā)布時間:2021-07-12 14:36:50 來源:億速云 閱讀:156 作者:小新 欄目:移動開發(fā)

這篇文章主要介紹Android Studio報Integer types not allowed錯誤怎么辦,文中介紹的非常詳細(xì),具有一定的參考價值,感興趣的小伙伴們一定要看完!

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>標(biāo)簽內(nèi)不能使用android:textSize,系統(tǒng)有提示,說明可以的
2.根據(jù)報錯Integer tyes is not allowed,考慮到是不是類型有問題,?,改為12sp已ok
3,記得一定帶單位

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

以上是“Android Studio報Integer types not allowed錯誤怎么辦”這篇文章的所有內(nèi)容,感謝各位的閱讀!希望分享的內(nèi)容對大家有幫助,更多相關(guān)知識,歡迎關(guān)注億速云行業(yè)資訊頻道!

向AI問一下細(xì)節(jié)

免責(zé)聲明:本站發(fā)布的內(nèi)容(圖片、視頻和文字)以原創(chuàng)、轉(zhuǎn)載和分享為主,文章觀點不代表本網(wǎng)站立場,如果涉及侵權(quán)請聯(lián)系站長郵箱:is@yisu.com進行舉報,并提供相關(guān)證據(jù),一經(jīng)查實,將立刻刪除涉嫌侵權(quán)內(nèi)容。

AI