"center_horizontal | center_vertical"和"center_horizontal | center_vertical"之间有什么区别吗?和“中心" [英] Is there any difference between "center_horizontal|center_vertical" and "center"
本文介绍了"center_horizontal | center_vertical"和"center_horizontal | center_vertical"之间有什么区别吗?和“中心"的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我想在linearLayout中居中放置图像.
I want to center an image in a linearLayout.
两者之间是否有任何区别
Is there any difference between
android:gravity="center_horizontal|center_vertical"
和
android:gravity="center"
?
推荐答案
不,没有区别.根据源代码
No, there is no difference. According to source code
public static final int CENTER = CENTER_VERTICAL|CENTER_HORIZONTAL;
这篇关于"center_horizontal | center_vertical"和"center_horizontal | center_vertical"之间有什么区别吗?和“中心"的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文