简体   繁体   English

将顶部imageView与relativeLayout的中心对齐

[英]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? 如何设置imageView的布局参数以获得类似的信息? 在此处输入图片说明

Thanks!! 谢谢!!

I have prepared a Simple Hack Solution. 我准备了一个简单的黑客解决方案。 Make a dump View and Assign your View Top to it. 制作转储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" />

Hope this could help you...Any Query are Welcome :) 希望这可以帮助您...欢迎任何查询:)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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