Interface Builder change text color bug?

巧了我就是萌 提交于 2019-12-08 20:31:16

问题


This is driving me bananas..

If I select a UITextField in interface builder and go to change the text colour by manually entering the R G B values it changes the colour of the entire frame and background.

However if I change it using the sliders it changes the text colour only like I want.

Leads me to think its a bug... does this happen for anyone else?


回答1:


I see this happening with the latest version of Xcode as well. Both the Text Color and Background Color controls in the UILabel attribute inspector change at the same time when manually typing in a R G B value, whereas if I choose a color another way (e.g. from the crayons or palette views in the Color picker), only the text color control value changes.

I'd assume this is a bug (and should be filed via http://bugreporter.apple.com), but then again it's persisted through a few versions of Xcode so this may be their expected behavior on purpose. But I'd definitely agree you should file it as a bug.




回答2:


Definitely a bug! A temporary solution is to double click the text on the UILabel i.e. selecting all the UILabel text in the UI (storyboard or xib). Only so using the sliders changes the text colour. Hope it helps




回答3:


Or change the color and then set the background color back to transparent. For me the fastest workaround. Same bug with UILabel.



来源:https://stackoverflow.com/questions/11092685/interface-builder-change-text-color-bug

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!