如何在Android中的两个图像之间居中文本

时间:2011-04-06 01:59:23

标签: android image text center alignment

我需要在两个图像之间居中少量文本。这篇文章几乎实现了我想要的,但是文本是左对齐的,而不是在两个图像之间居中。

How to place a text between two images in Android

我尝试过使用android:layout_centerInParent,但文字显示在图片上而不是在它们之间包装。

任何帮助表示感谢。

提前致谢,

菲利普

2 个答案:

答案 0 :(得分:0)

我认为你应该使用linearlayout,方向是水平的。除了TextView应该设置layout_weight =“1”,

答案 1 :(得分:0)

添加android:gravity =“center”或android:layout_gravity =“center”。