最近在写代码时,偶然发现发现RelativeLayout 的setGravity并不是完全按照预想的设置进行展示,所以有一点纠结,刚开始以为是写的有问题,后来进行了一些测试发现,这个Gravity属性的确存在一些问题.
测试1:
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@android:color/holo_blue_bright"
android:gravity="bottom"
tools:context=".MainActivity">
<ImageView
andr