我正在尝试将 #ffffff
(白色)背景设置为 TextView 的 50% 不透明度。
我尝试使用 android:alpha=0.5
但它也使文本透明 50%。
我需要在白色背景上设置 50% 的不透明度。
我找到一个教程 Here但不明白那么多。
请提供任何引用资料。 提前致谢。
最佳答案
在您的布局文件中,只需将 TextView 的背景设置为“#8FFF”
<TextView
android:layout_width="..."
android:layout_height="..."
android:background="#8FFF"
/>
这里 8 是 alpha 值,FFF 分别是 RGB 值。 See here for more info on the background attribute
关于android - TextView 的白色背景不透明度为 50%,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/20290605/