![](/img/trans.png)
[英]How to change UILabel text color based on the color of background image? (iOS)
[英]how to change the Label/TextField text color Based on background image color in iOS Objective-C?
我正在使用帶有Labels和TextFields的UIImageView。 在我的場景中,如何根據背景圖像更改標簽文本的顏色?
例如 :“我的背景”圖像為白色,在這種情況下,標簽文本顏色為黑色或紅色(白色除外)。
請幫我。 提前致謝。
只是在線尋找答案的工程:
計算背景圖像的平均顏色 : 如何查找圖像的平均顏色
將label.textColor
設置為結果顏色
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.