Android TextView在上方和下方都有不需要的细黑线

时间:2013-08-01 15:05:42

标签: android textview

我正在使用TextViews来渲染谈话气泡,这些气泡由9个补丁.png图像组成,这些图像被拉伸以适应角色所说的任何内容。在对话发生时,相同的TextView以编程方式重复使用,调整大小并移动到屏幕上的不同位置。

除非有时在TextView空间的边缘(.png本身具有透明背景)上方和下方有一条很薄的(可能是1像素)黑线,所以一切看起来都很好。

我已经在网上搜索了一个星期,但发现没有人有这个完全相同的投诉或基于任何甚至模糊相似的任何解决方案。

有什么想法吗?

[按要求添加:.xml和截图(突然今天早上我的声誉达到了11 - 哇哦!)

<FrameLayout    
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:orientation="horizontal"
android:layout_width="match_parent"
android:layout_height="match_parent"   
tools:context=".ActivityPreMomGirl"
android:background="@drawable/bg_pre_mom_girl"
android:id="@+id/mom_girl_cb" >    

<TextView
    android:id="@+id/talk_chat"        
    android:background="@drawable/talk_chat"           
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"          
    android:visibility="invisible" />

</FrameLayout>

Black lines barely visible, but clearer and more unsightly in reality.

2 个答案:

答案 0 :(得分:0)

您为什么使用TextView?如果您想在某些背景上显示文字,为什么不使用ImageView

答案 1 :(得分:0)

在我的情况下,通过在EditText元素中添加“android:background =”@ android:color / transparent“解决了这个问题