簡體   English   中英

將頂部imageView與relativeLayout的中心對齊

[英]Align top imageView with the center of a relativeLayout

如何設置imageView的布局參數以獲得類似的信息? 在此處輸入圖片說明

謝謝!!

我准備了一個簡單的黑客解決方案。 制作轉儲View並為其分配View頂部。

<View
    android:id="@+id/view1"
    android:layout_width="match_parent"
    android:layout_height="0dp"
    android:layout_centerHorizontal="true"
    android:layout_centerVertical="true" />

<ImageView
    android:id="@+id/imageView1"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:layout_alignTop="@id/view1"
    android:layout_centerHorizontal="true"
    android:src="@drawable/ic_launcher" />

希望這可以幫助您...歡迎任何查詢:)

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

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