![](/img/trans.png)
[英]error: Error: Integer types not allowed (at 'layout_height' with value '10')
[英]Error:(12, 21) String types not allowed (at 'android:layout_height' with value ''). with 3dp
我將<item name="android:layout_height">3dp</item>
定義為我的自定義樣式中的一項。 但是我收到以下錯誤消息:
錯誤:(12,21)不允許使用字符串類型(在“ android:layout_height”處,值為“)。 錯誤:任務':app:processDebugResources'的執行失敗。 com.android.ide.common.process.ProcessException:org.gradle.process.internal.ExecException:處理'command'/home/juude/prog/android-sdk-linux/build-tools/22.0.1/aapt''用非零退出值1完成
我認為這可能是android studio問題,因為我在之前的版本中沒有遇到此問題。 從那以后,我一直沒有改變這種風格。 但我不明白為什么。
我找到了解決方案,您無法在樣式定義中定義大於0的<dimen name="the_height">50dp</dimen>
我將<dimen name="the_height">50dp</dimen>
定義為<dimen name="the_height">50dp</dimen>
,然后進行<item name="android:layout_height">@dimen/the_height</item>
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.