简体   繁体   English

UISegment在Xib中已选择/未选择的颜色

[英]UISegment selected/unselected color in xib

My app has separate code and bundle (xib are to be downloaded separately). 我的应用程序具有单独的代码和捆绑包(xib将单独下载)。 I can't change my code yet and I have to change xib file. 我还不能更改代码,必须更改xib文件。

On ios 7, I can see correctly like this when I change in my xib. 在ios 7上,更改xib时可以看到正确的图像。

在此处输入图片说明

在此处输入图片说明

With that setting, on my ios 6, selected color and unselected color become same (black). 通过该设置,在我的ios 6上,选定的颜色和未选定的颜色变为相同(黑色)。 User can't differentiate. 用户无法区分。

在此处输入图片说明

How can I change in my xib so that behaviour is correct? 如何更改我的xib,以确保行为正确? (I can't change my code for now. I can only change xib). (我暂时不能更改代码。只能更改xib)。 If Tint color is default, it is okay but I still need it to be black color. 如果默认颜色是“色调”,那可以,但是我仍然需要将其设置为黑色。

you are setting tint color, which is correct approach. 您正在设置色调颜色,这是正确的方法。 It's background color is white that means it's default color and you are setting black color as tint color so it is also fine. 它的背景颜色是白色,这意味着它是默认颜色,并且您将黑色设置为淡色,因此也很好。

So make sure that your SegmentControl 's style is plain and state is not checked beside Momentary . 因此,请确保您的SegmentControl样式plain并且未在Momentary旁边checked state Make sure that state is unchecked. 确保未选中状态。 If it is checked then uncheck it. 如果已选中,则取消选中它。 You can check all this under attribute inspector with your segmented control selected. 您可以在attribute inspector下选中所有分段控件,然后检查所有这些。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM