简体   繁体   中英

Align top imageView with the center of a relativeLayout

how could set the layout parameters of the imageView in order to get something like this? 在此处输入图片说明

Thanks!!

I have prepared a Simple Hack Solution. Make a dump View and Assign your View Top to it.

<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" />

Hope this could help you...Any Query are Welcome :)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM