how to set a view's background color using a precise hex via interfacebuilder?

StackOverflow https://stackoverflow.com/questions/23560288

  •  18-07-2023
  •  | 
  •  

سؤال

In IB, when I go to the attributes inspector and click the "background" drop down -> other, I get a color pallet with several tabs (wheel, slider, apllets) but there is no place to set a precise such as #ff5911 for example.

Is there a way to do that without using code?

هل كانت مفيدة؟

المحلول 3

Add a hex color picker to your system. I use http://wafflesoftware.net/hexpicker/.

نصائح أخرى

In Xcode 6, you can set hex values in the RGB slider tab.

enter image description here

You can switch to the RGB-Slider and use the RGB value of your hex code. There are several converters in the web: http://www.javascripter.net/faq/hextorgb.htm

ff5911 => R: 255, G: 89, B: 17

I think there isn't the possibility in the Interace Builder to directly put in the hex value. Another way would be using the "magnifier" symbol and click on the desired color.

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top