簡體   English   中英

不允許使用字符串類型(“重力”值為“ end”)

[英]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.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM