uisegmentedcontrol

Multiple selection of segments in UISegmentedControl

家住魔仙堡 提交于 2019-12-22 13:55:11
问题 Can the UISegmentedControl allow multiple selection of segments? Otherwise should we create custom controls? 回答1: By default, UISegmentedControl does not support multiple selection. For such a case, a custom control should be the desired solution; I would recommend to check ATHMultiSelectionSegmentedControl library, it does provided the desired behavior of what are you looking for, it is easy to use and now it is compatible with the latest Swift version (which is 3 at the time I posted my

UISegmentedControl Color Issue - Color Shows Fine on Simulator, Not on Device

天涯浪子 提交于 2019-12-22 11:28:51
问题 FIXED! You won't believe it... It was a Winterboard theme messing with it! The bugger! Disabled theme and voila, works perfectly. The theme in question was "Ayecorn" for anyone interested. Not cool! Hope this helps anyone else who encounters the same issue. Sorry folks, and thanks for all the input! Great community here. Original Question: So a simple test iPhone app in Xcode 4.5: Create a view with a UISegmentedControl via Storyboard, and set the color via attributes inspector. Run it on

Change textColor in UISegmentedcontrol

孤街浪徒 提交于 2019-12-22 01:04:53
问题 I use below code for change textcolor of each segmented in UISegmentedcontrol how can I change textcolor of specific segment?(for example segment at index 2) for (id seg in [segment subviews]) for (id label in [seg subviews]) if ([label isKindOfClass:[UILabel class]]) [label setTextColor:[UIColor redColor]]; 回答1: i use below code for this problem int eg=0; for (id seg in [sg subviews]) { int gg=sg.selectedSegmentIndex; if(gg==2) gg=0; else if(gg==0) gg=2; if(eg==gg && eg!=1) { for (id label

Scroll dynamic UISegmentedControl in Swift 3

让人想犯罪 __ 提交于 2019-12-21 20:55:26
问题 Hi i want to create a dynamic UISegmented View with more than 20 Items. I tried it, but the output is like this. the text is sliced not visible fully. I want it to scroll to the left and right and also display the full text. can some one help me to fix this. tnx View Controller override func viewDidLoad() { super.viewDidLoad() let items = ["All Fruits", "Orange", "Grapes", "Banana", "Mango", "papaya", "coconut", "django"] let filtersSegment = UISegmentedControl(items: items) filtersSegment

Segmented control to toggle through multiple tableviews

好久不见. 提交于 2019-12-21 02:43:23
问题 What I’m basically trying to is to implement the control segment/tableview as in Mailbox (see it around 2:00: http://www.youtube.com/watch?v=FG-h8pDXfoE&feature=youtu.be&t=2m) I am using Core Data in one UITableViewController hooked up to a UITableView . When user toggles the UISegmentedControl , the TableView is reloaded with a different set of NSPredicate , and UITableViewRowAnimationRight/Left , kind of makes it appear that that a different table view slides in and replaces the old one. As

UISegmentedControl with badge number

房东的猫 提交于 2019-12-21 02:02:09
问题 Just like the tabbar, I want to show badge on UISegmentedControl . As I cant see any predefined methods for UISegmentedControl just like available for UITabBar . I thought about adding the badge as an image just on top of it, but maybe there is some better way. 回答1: Here is a little third party library I've used to draw badges on various things. It's pretty nice. For example, changing the color of the badge to match my design was trivial. Once you bring this class into your project and

How to disable part of UISegmentedControl?

白昼怎懂夜的黑 提交于 2019-12-20 10:15:14
问题 Following is the code for UISegmentedControl UISegmentedControl *segmentedControl = [[UISegmentedControl alloc] initWithItems:[NSArray arrayWithObjects: [UIImage imageNamed:@"down.png"], [UIImage imageNamed:@"dList.png"], nil]]; [segmentedControl addTarget:self action:@selector(segmentAction:) forControlEvents:UIControlEventValueChanged]; segmentedControl.frame = CGRectMake(0, 0, 90, 65); segmentedControl.segmentedControlStyle = UISegmentedControlStyleBar; segmentedControl.momentary = YES;

How to create top Navigation like Reddit App in Swift 3

依然范特西╮ 提交于 2019-12-20 05:16:25
问题 Here is the UI i want to create: and what the complete UI looks like: but i want to create first top Navigation. i tried https://github.com/subinspathilettu/SJSegmentedViewController Which is working but it shows navigation after that it shows SegmentView.Could someone help me to create this UI it's same like reddit app screen after login.I need in swift.Thanks in advance 回答1: Okay. Here is the solution. Step 1: Take no. of buttons you want in a UIView. Take UILabel for equal width of each

UISegmentcontrol appearances causing issues

浪尽此生 提交于 2019-12-20 04:52:37
问题 i need help on my UISegment appearances, i set this in my app delegate everything works fine. till i add in this code to change my selected segment color, it caused an issues. i called the IBAction when viewDidLoad. it supposed to show this but instead it show this, i know is the appearance issues but not sure now to fix it...when i commented the appearances codes it will the first picture. appdelegate //normal segment [[UISegmentedControl appearance] setTitleTextAttributes: [NSDictionary

uiscrollview won't cancel content touches for uisegmentedcontrol

空扰寡人 提交于 2019-12-20 03:55:17
问题 I've subclassed th UIScrollView and overriden the touchesShouldCancelInContentView: method the following way: -(BOOL)touchesShouldCancelInContentView:(UIView *)view { if ([view isKindOfClass:[UIButton class]] || [view isKindOfClass:[UISegmentedControl class]]) { return YES; } if ([view isKindOfClass:[UIControl class]]) { return NO; } return YES; } It works perfectly for UIButton, but it doesn't work for UISegmentedControl. Any help would be appreciated 回答1: Finally figured it out. Had to