我正在Android Studio上做一個小專案,我把一張圖片作為深藍色的背景。 我在這個深藍色的圖上面插入了白色的文字,但是字母中的白色還是沒有顯示出來。 圖形界面。看,我把顏色放成了白色,但還是沒有顯示出來。 請查看:
請問,誰能幫助到 [1]: https://i.stack.imgur.com/iTtiS.png
XML中的源代碼。 [2]: https://i.stack.imgur.com/u6AIU.png
請問,在Android Studio中,圖片上面出現的白色文字該怎么處理?
整個XML布局:
<?xml version="1.0" encoding="utf-8"? >
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"/span>
xmlns:app="http://schemas.android.com/apk/res-auto"。
xmlns:tools="http://schemas.android.com/tools"。
android:layout_width="match_parent"。
android:layout_height="match_parent"。
tools:context=".MainActivity"/span>>
<androidx.constraintlayout.widget.ConstraintLayout。
android:layout_width="410dp"/span>
android:layout_height="250dp"/span>
android:color="@color/white"。
android:foreground="@drawable/home_bg"/span>
android:textSize="30dp"。
android:textStyle="bold"。
app:layout_constraintEnd_toEndOf="parent"。
app:layout_constraintHorizontal_bias="0.0"/span>
app:layout_constraintStart_toStartOf="father"
app:layout_constraintTop_toTopOf="parent">
<TextView。
android:id="@ id/textView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"。
android:text=" Encontre o seu próximo destino!"
android:textColor="@android:color/white"。
android:textSize="20dp"。
app:layout_constraintBottom_toBottomOf="father"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.32"/span>
app:layout_constraintStart_toStartOf="father"
app:layout_constraintTop_toTopOf="parent"。
app:layout_constraintVertical_bias="0.233"/span> />
<TextView
android:id="@ id/textView2"/span>
android:layout_width="176dp"。
android:layout_height="41dp"/span>
android:layout_marginBottom="64dp"。
android:text="Procurar Destinos"
android:textColor="#FFFFFF"。
android:textColorHighlight="@color/white"。
android:textSize="20dp"。
android:textStyle="bold"/span>
app:layout_constraintBottom_toBottomOf="parent"。
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.324"/span>
app:layout_constraintStart_toStartOf="father"
app:layout_constraintTop_toBottomOf="@ id/textView"
app:layout_constraintVertical_bias="0.742"/span> />
</androidx.constraintlayout.widget.ConstraintLayout>
</androidx.constraintlayout.widget.ConstraintLayout>/span>
uj5u.com熱心網友回復:
好吧,我認為問題在于你設定了約束布局的前景,而不是背景。
試一下:
<androidx.constraintlayout.widget.ConstraintLayout。
android:layout_width="410dp"/span>
android:layout_height="250dp"/span>
android:color="@color/white"。
android:background="@drawable/home_bg"
android:textSize="30dp"。
android:textStyle="bold"。
app:layout_constraintEnd_toEndOf="parent"。
app:layout_constraintHorizontal_bias="0.0"/span>
app:layout_constraintStart_toStartOf="father"
app:layout_constraintTop_toTopOf="parent">
轉載請註明出處,本文鏈接:https://www.uj5u.com/qiye/313057.html
標籤:
上一篇:嘗試僅使用jqueryajax在mvcwebapi專案中上傳影像
下一篇:影像視圖在運行時不渲染
