-
Notifications
You must be signed in to change notification settings - Fork 199
UISegmentedControl #12
Comments
I get a crash with the latest version on Cocoapods (0.0.12) in UI7SegmentedControl, l. 57. The crash happens because the |
Thank you for report. Which version of iOS did you tried? |
This was on the iOS 6.1 Simulator. |
Though I could not represent this problem, I found a hole in UI7View and fixed it. |
The problem is that for some reason |
@youknowone yep, thanks! |
Crashes on real machine(runs successfully on simulator) [self setDividerImage:self.tintColor.image
forLeftSegmentState:UIControlStateNormal
rightSegmentState:UIControlStateNormal
barMetrics:UIBarMetricsDefault]; I traced logic, then I found difference between real and simulator. [self __tintColor] returns nil on simulator. return non nil on real machine. the exception is following; |
@hamadeguchi Thank you for report! I fixed it and released new version. |
Thank you for your quick response. I confirmed it solved! FYI: |
Warning also removed. It will be included in next release. |
I have a problem with this control when using in iPod 4th with iOS6. The segmented control present just a line in the middle of the text, very ugly. |
@gribeiro-mobirama Sorry. Because I don't have iPod 4th, I couldn't test this control on it. Could you represent it on simulator? Or show me representable code for that? |
Yes, in iPhone Simulator in Xcode DP2: My code: NSDictionary * selectedAttributesDictionary = [NSDictionary dictionaryWithObjectsAndKeys:
[UIColor whiteColor],
UITextAttributeTextColor,
nil];
NSDictionary * deselectedAttributesDictionary = [NSDictionary dictionaryWithObjectsAndKeys:
[UIColor redColor],
UITextAttributeTextColor,
nil];
[segmentedControl setTitleTextAttributes:deselectedAttributesDictionary forState:UIControlStateNormal];
[segmentedControl setTitleTextAttributes:selectedAttributesDictionary forState:UIControlStateSelected];
for (int i = 0; i < [segmentedControl.subviews count]; i++)
{
[[segmentedControl.subviews objectAtIndex:i] setTintColor:[UIColor redColor]];
} |
Unfortunately, I tried this code but didn't get that ugly stroke. (Test code is included current HEAD) But I found you are setting subview's tint colors. UI7Kit is implemented with all other codes, but is not touching subviews. How about try to set entier tint color like:
In your method, it will not change entire color theme but will change only partial parts. About the stroke, I need more information. Try test app of current HEAD and check the |
Thanks a lot man! I did like you did, initializing the segmentedcontrol in ViewDidLoad with frame size. That worked fine, but in iOS6, just blue, not red. In iOS7, the red tint color worked normally. And clue about this tint color in iOS6? Am I doing shit again? |
setTintColor: should work well in both OS. But it is fixed in recent days. So you may using unfixed UI7Kit yet. I updated UI7Kit just now. Try updating this. If it still does not work after updating, it is UI7Kit bug. Please let me know it. |
Thanks a lot! That worked fine! Great job! |
@gribeiro-mobirama I found iOS7 SDK + Interface Builder + 3.5 inch screen can make this problem. Is this right? I didn't noticed this because i tested all the code from iOS6 SDK. |
Yes. That ugly stroke just happened with me when under these conditions. If you could fix it, would be nice for others. To me, creating the segmetedcontrol programatically resolved. 👍 |
It is iOS7 SDK bug. (Without UI7Kit, it still is broken) |
Interesting information. Thank you @tracid |
@gribeiro-mobirama @tracid I prevented UISegmentedControl's height become less than 1px. I found this helps problems, at least in some case. |
Meanwhile I've updated to iOS7 SDK & Xcode 5 DP4. Running on the iOS 6.1 simulator, 0.6.1 still doesn't fix the problem (UISegmentedControl added to an autolayout XIB). But setting a constraint on the height to 29 works the problem around. |
Depressing... I may should add constraint in the initWithCoder: for iOS6 |
The text was updated successfully, but these errors were encountered: