我自己制作了一张 forum_title_bg.9.png 的图片用来当做下面布局文件的背景,但是使用后怎么textview中的文字被遮挡了,不显示了?我从别的APK中随便提取了张.9.png的图片替换后,就能显示,是我制作的图片不对吗?
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@drawable/forum_title_bg">
<TextView
android:id="@id/forum_title_item"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="10dp"
android:text="标题"
android:textColor="@color/blue"
android:textSize="20sp"/>
</RelativeLayout>
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号
没有看到.9图 以及效果图。怀疑是Padding box不对 如图。

你吧Padding box 2条边都拉到和图片一样长度,然后要设Padding的话,自己在XML里设置