Android-重叠两个textviews [英] Android - Overlap two textviews
问题描述
我在LinearLayout中有两个TextView.我在下面的页面上设置了一个负填充以使其凸起(使用TextView.setPadding).我对他们两个都做了setBackgroundColor(android.R.color.transparent),希望这能让他们彼此展示.
I have two TextViews in a LinearLayout. I set a negative padding on the lower one to bump it up (using TextView.setPadding). On both of them I did setBackgroundColor(android.R.color.transparent), hoping this would let them show through each other.
结果:
我希望'fun'中的'f'完全显示-我不在乎文字是否确实重叠.我不知道TextView是否正在剪辑它,或者上部TextView是否覆盖了它,或者两者都没有.
I'd like the 'f' in 'fun' to show up completely - I don't mind if the text actually overlaps. I don't know if the TextView is clipping it or if the upper TextView is covering it up or both.
推荐答案
设置TextView
android:background="#00000000"
这将为您的TextView
提供透明的背景.
#00000000
是按Alpha,Red,Blue,Green顺序排列的十六进制颜色.像这样:
Set the TextView
android:background="#00000000"
That will give your TextView
a transparent background.
The #00000000
is a hexadecimal color in the order of Alpha, Red, Blue, Green. Like so:
#AARRGGBB
也-我认为它是填充,而不是正在剪切的其他文本字段.尝试改用负数android:layout_marginTop
.
Also - I think its the padding, and not the other text field that is clipping. Try using a negative android:layout_marginTop
instead.
这篇关于Android-重叠两个textviews的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!