Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8578301
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T20:21:23+00:00 2026-06-11T20:21:23+00:00

I use this code to create a UISegment: //segment controll NSString *key2 = [allKeys2

  • 0

I use this code to create a UISegment:

//segment controll

            NSString *key2 = [allKeys2 objectAtIndex:i];

            NSString *obj2 = [DictionaryHomework objectForKey:key2];

            int val;
            val = [obj2 intValue];

            //segment controll

            NSArray *itemArray2 = [NSArray arrayWithObjects: @"very easy", @"easy", @"ok", @"hard", @"challenging", nil];
            UISegmentedControl *segmentedControl2 = [[UISegmentedControl alloc] initWithItems:itemArray2];
            segmentedControl2.frame = CGRectMake(480, -60, 130, 350);
            segmentedControl2.segmentedControlStyle = UISegmentedControlStyleBar;
            segmentedControl2.selectedSegmentIndex = val - 1;
            [segmentedControl2 addTarget:self action:@selector(segmentedControlHomework:) forControlEvents:UIControlEventValueChanged];

            segmentedControl2.transform =
            CGAffineTransformRotate(segmentedControl2.transform, degreesToRadians(90));

            NSArray *arr = [segmentedControl2 subviews];
            for (int i = 0; i < [arr count]; i++) {
                UIView *v = (UIView*) [arr objectAtIndex:i];
                NSArray *subarr = [v subviews];
                for (int j = 0; j < [subarr count]; j++) {
                    if ([[subarr objectAtIndex:j] isKindOfClass:[UILabel class]]) {
                        UILabel *l = (UILabel*) [subarr objectAtIndex:j];
                        l.transform = CGAffineTransformMakeRotation(- M_PI / 2.0); //do the reverse of what Ben did
                    }
                }
            }

            [image1 addSubview:segmentedControl2];

            segmentedControl2.tag = i;

            [segmentArray addObject: segmentedControl2];

            //segment control

On ios5 the control loads the titles in horizontal, while in ios6 in vertical. Why is this? has there been a change in iOS6?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-11T20:21:25+00:00Added an answer on June 11, 2026 at 8:21 pm

    You are fiddling with the inner mechanics of the UISegmentedControl. While you are not technically using private APIs, you are still accessing parts of UIKit that are not publicly documented.

    One reason the behavior might have changed in iOS 6 could be that the segmented control now builds its subviews lazily in layoutSubviews ore some other place. It might even not use subviews at all. But I’m just making guesses here. However, it’s Apple’s choice to change undocumented internals of the framework.

    Your code should never have been used in a shipping app. If you want to do something like this (vertical segments?) that the build-in segmented control can’t do, build it on your own.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

i'm starter in jqgrid, i write this code for create and fill jqgrid(i'm use
This is the code i use to create a graph which searches for .csv
I use this code to create all day event on Exchange 2010sp1: <?xml version=1.0
I use this code to create and plot N points: N=input('No. of Nodes:'); data
I use this code to create and plot N points: N = input('No. of
I use this piece of code to create some NSOperations and add them to
I use this code to create and show a MessageWindow: var newTitleWindow:MessageWindow = PopUpManager.createPopUp(contextView,MessageWindow,
I use this code to create a simple jquery carousel animation: $(document).ready(function() { var
I use this code to create and run the timer, which works OK. NSDate
I'd like to create schema automatically, if not exists. Currently I use this code

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.