layout_marginBottom不起作用的问题
在FrameLayout中对金币图像ImageView设置layout_marginBottom ="8dp"不会起作用,一定要加上layout_gravity = "bottom" 金币图像才会显示到底部,这是为什么??
代码如下:
<FrameLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content">
<ImageButton
android:id="@+id/delete_imgButton"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@drawable/delete_button_selector"/>
<ImageView
android:id="@+id/iv_delete_button"
android:layout_width="15dp"
android:layout_height="15dp"
android:background="@drawable/game_coin_icon"
android:layout_marginBottom="8dp"
android:layout_gravity="bottom" // 不设置这一句layout_marginBottom就不起作用
android:layout_marginLeft="8dp"
/>
<TextView
android:id="@+id/tv_delete_consume_coin"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="30"
android:textSize="12sp"
android:textColor="@color/white"
android:layout_gravity="bottom|right"
android:layout_marginRight="9dp"
android:layout_marginBottom="8dp"/>
</FrameLayout>