uisegmentedcontrol

Make 2 segments the size of 1 in UISegmentedControl

↘锁芯ラ 提交于 2019-12-13 08:25:27
问题 I have a UISegmentedControl with 3 segments created in the storyboard . I want to programmatically add another segment, and make the middle 2 segments the size of 1 segment. Here is an image to illustrate: In storyboard : What I want to achieve programmatically: This is what I tried: CGFloat segmentWidth = self.segment.frame.size.width; [self.segment insertSegmentWithTitle:@"titleName" atIndex:2 animated:NO]; [self.segment setWidth:segmentWidth / 4 forSegmentAtIndex:1]; [self.segment setWidth

How do you customize the border of a UISegmentedControl in swift

♀尐吖头ヾ 提交于 2019-12-13 08:14:31
问题 I'm trying to make make the top border of a UI segmented control one color and the bottom border of a UISegmented control another color. I can do it with a UIView, but it doesn't work correctly with a segmented control for some reason. 回答1: I suggest you to use custom divider images. Please refer either to "Customizing appearance of UISegmentedControl" article or "UIKit User Interface Catalog" topic. 来源: https://stackoverflow.com/questions/33403841/how-do-you-customize-the-border-of-a

Xcode invisible elements

邮差的信 提交于 2019-12-13 08:05:33
问题 I don't know what happened. Elements items like buttons or segmented control are invisible in main storyboard. Cellphone is the same. I put the image, of what I mean 回答1: It looks like you accidentally changed the view's (or window's) Tint Color to white. (Or you could even have turned it to Clear color, or no color at all.) This would cause the text of the button or segmented control to be invisible, because it is white on white. The segmented control has a border but it would turn white too

Can I use pushViewController with UISegmentedControl?

荒凉一梦 提交于 2019-12-13 05:49:18
问题 I want to use pushViewController with UIsegmentedController to push to other view and xib. Can I do that in xcode 4 ??? If I can , Could you guide me please ? Here is some code that I try.But won't work. -(IBAction) segmentedControlIndexChanged:(id)sender { if ([sender selectedSegmentIndex] == 0) { BDshelveController *shelve_page = [[BDshelveController alloc] initWithNibName: @"BDshelveController" bundle:nil]; } else if([sender selectedSegmentIndex] == 2) { BDlibraryController *lib_page = [

Recreating Segmented Control from iPhone App Store

让人想犯罪 __ 提交于 2019-12-12 05:35:50
问题 I'm trying to recreated an interface similar to the app store, using a navigation bar with a segmented control directly below it. I have the controller and all associated views working perfectly; my problem is that I would like to match the color of my segmented controller to the same color that apple uses in the store. How would I go about achieving this? I've experimented with colorWithRed:green:blue:alpha but with little success. Thanks. 回答1: You can use: [mySegmentedControl

Use SegmentController to Make TableView Disappear and UIContainerView Appear

孤街浪徒 提交于 2019-12-12 04:46:39
问题 I'm trying to use a segment controller to switch between my tableView and a container view, but when I try to switch between them it only half works. The TableView appears and disappears, but the container view never appears. Here is my code: @IBAction func switchAction(_ sender: UISegmentedControl) { if sender.selectedSegmentIndex == 0 { profileTableView.isHidden = false modelsContainerView.isHidden = true } else { profileTableView.isHidden = true modelsContainerView.isHidden = false } }

UISegmentedControl with Direction or Arrow theme

核能气质少年 提交于 2019-12-12 03:35:28
问题 I have implemented UISegmentedControl with Direction theme using BASequenceControl from cocoacontrols.com . I have added BASequenceControl.h and BASequenceControl.m classes and required images from GitHub Great. Its working fine for me..However I have a concern with the last segment section tip. Its displaying the junk space of last segment section. Original Screen Shot I need like this The code I have Implemented #import "BASequenceControl.h" BASequenceControl *bASequenceControl = [

Issues with container view

↘锁芯ラ 提交于 2019-12-12 03:16:46
问题 I had created a page which has two container views that switch according to a segmented control on top. Basically I hide one of the container views based on what index is selected in the segmented control. Now within one of the container views, I added a table view and a cell. I also created a viewController class for the view contained in one of the containerviews which conforms to the UITableView DataSource and Delegate Protocols. When i run the app however, the segmented view is not

How can i get each Segment on uisegmentcontroler with diffrent image?

人走茶凉 提交于 2019-12-12 02:18:33
问题 I need different images on each segment of UISegmentController, I tried many solutions in Stackoverflow but none of them satisfied my need. Im new to IOS, So please help me. Also change image on each selection with some other jpg files. Presently I'm using this method UIImage *segmentUnselected = [UIImage imageNamed:@"26.png"]; [[UISegmentedControl appearance] setBackgroundImage:segmentUnselected forState:UIControlStateNormal barMetrics:UIBarMetricsDefault]; But i want different images for

iOS 5, storyboards: customize programmatically created UITableView for every UIView

瘦欲@ 提交于 2019-12-12 00:10:02
问题 In storyboards I've created an UIViewController and added more two UIViews to the same storyboard. Then added UISegmentedControl to enable switch between these UIViews. The method I use to switch between UIView: -(IBAction)segmentValueChaged:(id)sender { if(self.segment.selectedSegmentIndex==0) { [self.coinageView removeFromSuperview]; [self.view addSubview:nominalsView]; [self populateNominals:self.subCountryID]; } else { [self.nominalsView removeFromSuperview]; [self.view addSubview