uisegmentedcontrol

UISegment value changing when tableview get scrolled

可紊 提交于 2019-12-19 11:55:28
问题 I am using UISegmentControl to display objective type questions in table view. But, if I select one segment in any one of cell, then if I scroll, some segment values are changed. I dont know how to solve that. Kindly guide me. Cell size : 160px Segment tint color : blue color Coding //UIViewController func numberOfSectionsInTableView(tableView: UITableView) -> Int { return 1 } func tableView(tableView: UITableView, numberOfRowsInSection section: Int) -> Int { return 10 } func tableView

How to put a UISegmentedControl under a NavigationController?

…衆ロ難τιáo~ 提交于 2019-12-19 10:35:27
问题 I was wondering what the best approach in order to have a UISegmentedControl appears just under the a navigationController just like in the AppStore application: The content I what to put in the different views are UITableView just like the AppStore app. What I was thinking so far was: a viewController with the UIToolbar with UISegmentedController in this ViewController attaching my UITableViews But what I can't figure out, is how to structure my controller source code files. Do you have best

UISegmentedControl not expanding size for navigation bar/very squished

心不动则不痛 提交于 2019-12-19 04:21:10
问题 Running through an iPhone SDK book and one of the examples has me creating a table and then later adding a UISegmentedControl to the table for sorting. I dutifully did this in IB, and it looks great: IB Screenshot http://img.skitch.com/20100529-83sefni21q4nj51rw1mghh2yj1.jpg When I run it in the simulator or my phone, it's totally squished: Squished http://img.skitch.com/20100529-x3pmr7gkb6xpm766bupi7quy55.jpg The buttons work perfectly, it's just they are not sizing according to their

UISegmentedControl not expanding size for navigation bar/very squished

隐身守侯 提交于 2019-12-19 04:21:06
问题 Running through an iPhone SDK book and one of the examples has me creating a table and then later adding a UISegmentedControl to the table for sorting. I dutifully did this in IB, and it looks great: IB Screenshot http://img.skitch.com/20100529-83sefni21q4nj51rw1mghh2yj1.jpg When I run it in the simulator or my phone, it's totally squished: Squished http://img.skitch.com/20100529-x3pmr7gkb6xpm766bupi7quy55.jpg The buttons work perfectly, it's just they are not sizing according to their

How to resize text (font) to fit in UISegment of UISegmentedControl?

做~自己de王妃 提交于 2019-12-19 02:26:48
问题 Is there any way to reduce font size that can be fit in single segment of UISegmentedControl ? Have tried many thing something like, [[UILabel appearanceWhenContainedIn:[UISegmentedControl class], nil] adjustsFontSizeToFitWidth]; [[UILabel appearanceWhenContainedIn:[UISegmentedControl class], nil] setMinimumScaleFactor:0.5]; AND NSArray *arr = segment.subviews; // segment is UISegmentedControl object for (int i = 0; i < arr.count; i++) { UIView *aSegment = [arr objectAtIndex:i]; for (UILabel

Why are my UISegmentControl segments highlighting in iOS 8 when I have set background images for all states?

自古美人都是妖i 提交于 2019-12-18 15:32:14
问题 In iOS 6/7, I have used UISegmentedControl with background images to create an effect like so: I accomplished this by setting the background image for the UISegmentedControl for each of standard states, like so: UIImage *segmentedControlBackgroundImage = [UIImage imageNamed:@"profileSegmentedControlBackground"]; UIImage *segmentedControlBackgroundSelectedImage = [UIImage imageNamed:@"profileSegmentedControlBackgroundSelected"]; [self.segmentedControl setBackgroundImage

Get frame from certain UISegmentedControl index?

*爱你&永不变心* 提交于 2019-12-18 13:32:02
问题 In my app, I use a UIPopoverController and I use the presentPopoverFromRect API. What I am doing now is just setting it to the frame of my whole UISegmentedControl. However I want to be more precise than this. Is there any way to get the frame of a specific index in the UISegmentedControl? Thanks! 回答1: If the segments are equal, why not just divide the width of the control by the number of the selected segment (+1 because numbering starts at 0)? EDIT: Like this -(void)showPopover:(id)sender {

How to set image to the UISegmentedControl in iPhone?

风流意气都作罢 提交于 2019-12-18 11:32:51
问题 I am new to iPhone development. I have created UISegmentedControl having 2 segments. I want to display images for each segment instead of title. Here is my code NSArray *itemArray = [NSArray arrayWithObjects: @"segment1", @"segment2", nil]; UISegmentedControl *segmentedControl = [[UISegmentedControl alloc] initWithItems:itemArray]; segmentedControl.frame = CGRectMake(5,100,300,40); segmentedControl.segmentedControlStyle = UISegmentedControlStyleBar; segmentedControl.selectedSegmentIndex = 1;

Using a UISegmentedControl in the footer of UIPopoverController

时光总嘲笑我的痴心妄想 提交于 2019-12-18 10:30:46
问题 In my iPad app Viewfinder (iTunes Link), I'm trying to recreate the look of a UISegmentedControl as seen in the footer of Keynote's Build In popover: The iPad HIG suggests using a bottom-aligned UIToolbar, but the appearance is incorrect. This screenshot shows Black Opaque, but none of the standard styles match Keynote. Any advice on recreating the Keynote look would be appreciated. If you don't have Keynote on the iPad, you can see the same technique in the footer of the Bookmarks popover in

iOS 13 Segmented Control: Remove swipe gesture to select segment

六月ゝ 毕业季﹏ 提交于 2019-12-18 05:00:12
问题 TLDR: How to remove the swipe/pan gesture recognizer for UISegmentedControl on iOS 13? Hi, on iOS 13, lots changed with UISegmentedControl. Mostly, the changes were appearance-based. But there is another functionality change that is messing up my app. On iOS 13, with UISegmentedControls, you can now swipe/pan to change the selected segment in addition to touching the segment you would like to select. In my app, I basically have a UISegmentedControl embedded in a scrollview. The