Android-重叠两个textviews [英] Android - Overlap two textviews

查看:428
本文介绍了Android-重叠两个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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆