. , , , , , . , UIView " ".
:
- UIView UISegmentedControl. , UIView UISegmentedControl
- UIView, .
- UIView UISegmentedControl
- UIView UISegmentedControl
- UIView, UISegmentedControl
UISegmentedControl , UIView UISegmentedControl.
UISegmentedControl , UIView UISegmentedControl.
UISegmentedControl.enabled.
, , , UISegmentedControl 1 , .
Here's what my custom segmented control looks like when applying this solution:
Enabled Segmented Management

Disabled Segmented Management

Here are some interesting snippets of code:
The UIView form corresponds to the UISegementedControl (load time configuration)
UISegmentedControl* segmentedControl = ...
UIView* view = ...
view.backgroundColor = [[UIColor whiteColor] colorWithAlphaComponent:0.6];
view.frame = segmentedControl.frame;
view.layer.cornerRadius = 5
view.clipsToBounds = YES;
view.userInteractionEnabled = NO;
Enable / Disable UISegementedControl (Runtime Change)
BOOL segmentedControlEnabled = ...
if(segmentedControlEnabled) {
segmentedControl.userInteractionEnabled = YES;
view.hidden = YES;
} else {
segmentedControl.userInteractionEnabled = NO;
view.hidden = NO;
}
What is it.
-
source
share