Android: background hides my text

I have widgets as shown below:

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/widget"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:background="@drawable/widget_bg">
<TextView android:layout_height="fill_parent"
 android:layout_width="fill_parent"
 android:id="@+id/widgetText"
 android:text="@string/sWaitingForLocation"
 android:layout_marginLeft="4dip"
 android:layout_marginRight="4dip"
 android:layout_marginTop="4dip"
 android:layout_marginBottom="4dip"
 android:textStyle="bold"
 android:gravity="center">
</TextView>
</LinearLayout>

But the text appears as if it is hidden behind the background.

My background is 9patch png. It works if I use android: background = "android: color / black" ... Could this be my png? (created using the android tool draw9patch tool)

+3
source share
3 answers

I found a problem: my ninety png was messed up.

0
source

It may also be the solution to your problem: Android Background hides the text of the child view . Can you tell me what is the problem with your 9 patch and how did you fix it?

+3
source

, :

  • ?
  • ?
0

Source: https://habr.com/ru/post/1760770/


All Articles