[英]error: Error: String types not allowed (at 'layout_gravity' with value 'start')
[英]String types not allowed (at 'gravity' with value 'end')
我想將圖像放在列表的最右端,並按照http://developer.android.com/reference/android/widget/LinearLayout.html#attr_android:gravity嘗試執行
<ImageView
android:id="@+id/list_now_playing"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="end"
>
</ImageView>
但是我遇到了錯誤。 請提出解決方案
該屬性值end
可在Android 4.0(ICS)中使用,而不低於該值。
第二件事是設置您可能需要將ImageView的fill_parent
/寬度設置為fill_parent
編輯
然后另一種將其移至最右端的方法將RelativeLayout
作為行的父級,並在ImageView
設置android:layout_alignParentRight="true"
和android:layout_centerVertical="true"
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.