New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Ability to set selected segment's label's text color #26
Comments
I made two changes that should help:
Hope it works for you! |
Perfect! Thanks for being so responsive! |
Not sure what I'm doing wrong here, but I get an unrecognized selector error in obj C (even though the function autofills). _ownedComponents is the multiselectedsegmentedcontrol: NSDictionary *attributes = @{NSForegroundColorAttributeName : [UIColor whiteColor]}; |
So I was thinking that you have the two colors: tint and background. Shouldn't they just be switched when the item is selected? Ex: My tint is blue-ish, my background is white. Is that what you meant for #1? If so, that #1 behavior is not working on my end. |
About the undefined selector: |
It won't compile if I set it to that. Says "no recognized selector" |
About the background color behavior: |
Do you get auto completion for the objc? |
Yes it autocompleted weirdly enough! |
I want the same colors whether or not it's night mode if that matters |
Also anyway to make the divider thinner? Feels like it's thicker than it used to be |
Where does the white comes from? The unselected background is clear. |
I've got it set to white in interface builder. If I set it to clear won't the background be dark? That'll clash with the blue color/make it hard to read |
dividers are the same width as border, so: multi.borderWidth = 0.5 |
Ah I looked in the code and could swear it was set to 1.0 |
Hmmm. didn't thing to use the control's own |
@IBInspectable open dynamic var borderWidth: CGFloat = 1 { Does this mean it's set to 1.0? |
Yes. |
Ohhh gotcha |
Fixing the background color thing, will push in a few minutes. |
Awesome! Thanks for being so responsive! |
You caught me in a good time! |
Hm still getting the same behavior |
Did you fix the sliver showing on the left? I still see that too. Maybe I messed something up |
Weird. Sure you updated the pod/package? Maybe do a Product>Clean and then try again. |
Clean rebuild fixed it! |
There's still an ever so small sliver of white on the leftmost segment if it's selected. Any idea what that is? I'm just worried that on other devices it might be even more pronounced! |
Probably antialiasing. Doesn't reproduce for me, maybe try to ensure the view is aligned to whole pixels and see if it changes anything. |
Ya it's definitely whole pixels. I didn't even realize you could set constraints that were sub pixel. Happens on another view where I use the tool that just uses autoresizemasks too |
When you test for the sliver of white on the side, have you set the border width to 0.5? It only happens when I try to make the border sizes look more like they used to by setting them to 0.5 |
Half pixel can happen unintentionally, as a result of centering or indenting. |
When the segment is selected, it sets the label color to .background.
This is fine for the default colors, but my tint is a shade of blue. I'd prefer that when the segment is selected, the text color is white, but in night mode the text will be black.
The text was updated successfully, but these errors were encountered: