1. 程式人生 > >Android問題:String types not allowed (at 'layout_gravity' with value 'top/right').

Android問題:String types not allowed (at 'layout_gravity' with value 'top/right').

android:layout_gravity="top/right"
出錯的是這一句。
實際上應該是:
android:layout_gravity="top|right",這裡的top和right的關係是並行的。
再說說layout_gravity的用法:
<p style="color: rgb(51, 51, 51); font-family: Arial; font-size: 14px; line-height: 26px;">屬性可選的值有:</p><p style="color: rgb(51, 51, 51); font-family: Arial; font-size: 14px; line-height: 26px;">top、bottom、left、right、center_vertical、fill_vertical、center_horizontal、fill_horizontal、center、fill、clip_vertical。</p><p style="color: rgb(51, 51, 51); font-family: Arial; font-size: 14px; line-height: 26px;">而且這些屬性是可以多選的,用“|”分開。</p><p style="color: rgb(51, 51, 51); font-family: Arial; font-size: 14px; line-height: 26px;">預設這個的值是:Gravity.LEFT</p><p style="color: rgb(51, 51, 51); font-family: Arial; font-size: 14px; line-height: 26px;">來自:</p><p style="color: rgb(51, 51, 51); font-family: Arial; font-size: 14px; line-height: 26px;">http://blog.csdn.net/wanderocn/article/details/6424876
</p>