Android 安卓按钮带有背景和文字,文字看起来不完整

Android 安卓按钮带有背景和文字,文字看起来不完整,android,button,text,background,Android,Button,Text,Background,“我的按钮”有背景图像和文本,但有些文本没有显示。 如果我删除android:background=。。。。行,文本看起来不错 我怎样才能纠正这个问题 多谢 <Button android:id="@+id/button_game_bottom" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignLeft="@+id

“我的按钮”有背景图像和文本,但有些文本没有显示。 如果我删除android:background=。。。。行,文本看起来不错

我怎样才能纠正这个问题

多谢

    <Button
    android:id="@+id/button_game_bottom"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:layout_alignLeft="@+id/layout_word7"
    android:layout_alignRight="@+id/layout_word9"
    android:layout_alignParentBottom="true"
    android:layout_marginBottom="5dp"
    android:background="@drawable/button_level"
    android:lines="1"
    android:text="NORMAL"
    android:textColor="#FFFFFF"
    android:textSize="20dp"
    android:textStyle="bold" />

您已将文本颜色设置为白色。您的
android:background=“@drawable/button_level”
背景是否也是白色的,并且出于任何原因,只包括
RMAL
部分


屏幕截图会很有帮助。

可绘制资源是位图还是xml文件?如果它是一个位图,如果您用xml定义了可绘制文件,比如:

<?xml version="1.0" encoding="utf-8"?>
<bitmap xmlns:android="http://schemas.android.com/apk/res/android" android:tileMode="repeat"/>


然后将可绘制的xml作为您的背景。

问题是9patch图像文件。9patch文件似乎已损坏。

您能否澄清一些文本没有出现?可能是屏幕截图?文本为“正常”,但按钮上文本的可见部分为“否”。我的背景颜色为黄色,我尝试更改文本颜色,但无效。您可以尝试将背景颜色更改为#E6FFFFFF。它是带有alpha组件的白色。我发现了问题,但我不明白为什么会这样。我的背景图像是9patch png,我用普通按钮背景更改了它,文本看起来不错。也许你的9-patch图像格式不正确?嘿,我面临着同样的问题。。你修改了你的九块图像文件了吗?你是怎么解决的