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

  • SEARCH
  • Home
  • 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 7864503
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T23:48:25+00:00 2026-06-02T23:48:25+00:00

I am trying to set the auto-resizing on a subclass of a navigation bar,

  • 0

I am trying to set the auto-resizing on a subclass of a navigation bar, and a segmented control. I need to do this in code, and not interface builder.

I want the code equivalent of this interface setup.

enter image description here

Edit:

I have tried this, but it does not work.

[self.segmentedControl setAutoresizingMask: UIViewAutoresizingFlexibleBottomMargin | UIViewAutoresizingFlexibleRightMargin | UIViewAutoresizingFlexibleLeftMargin];   
  • 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-02T23:48:26+00:00Added an answer on June 2, 2026 at 11:48 pm

    The View Programming Guide notes:

    The flexible width and height constants [UIViewAutoresizingFlexibleHeight and UIViewAutoresizingFlexibleWidth] from the preceding figure have the same behavior as the width and size indicators in the Autosizing controls diagram. However, the behavior and use of margin indicators is effectively reversed. In Interface Builder, the presence of a margin indicator means that the margin has a fixed size and the absence of the indicator means the margin has a flexible size.

    You want the bottom, left, and right margins to be fixed (which is the default), and the top margin to be flexible. Try this:

    [self.segmentedControl setAutoresizingMask: UIViewAutoresizingFlexibleTopMargin];
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to set the width in percent (80%) of the Facebook code.This doesn't
I'm trying to set my Auto Properties but they are non-static and so I
I am trying to set up an auto-complete search form with jQuery. I would
I'm trying to set up an auto-deploy from my springloops SVN through SFTP, but
Trying to set a flag in the post to allow processing or not. The
I am trying to create an Excel workbook where I can auto-set, or auto-adjust
I am trying to set the height of a DIV to auto when I
I'm trying to set up a model using UUIDs instead of auto-increment. Without bothering
I am trying to set the Margin of my Ellipse through code. How can
I am trying to set up Python on Windows 7. I haven't used this

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.