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 6011441
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T02:15:38+00:00 2026-05-23T02:15:38+00:00

i have a srollview with textfields and labels as its subview, for two textfields

  • 0

i have a srollview with textfields and labels as its subview, for two textfields i want to show UIpickerview.
For example: when user touches textfield11 i want to show a picker that slides up from the bottom of the screen, at this point i want to change height of my scrollview too, but it is not working.

CGRect scrollframe = scrollView.frame;
    NSLog(@"scrollframe.height=%f, pick height=%f",scrollframe.size.height, pick.frame.size.height);
    scrollframe.size.height -= pick.frame.size.height;
    [UIView beginAnimations:@"start" context:NULL];
    [UIView setAnimationDuration:0.2];
    [UIView setAnimationBeginsFromCurrentState:YES];
    [scrollView setFrame:scrollframe];
    NSLog(@"scroll height = %f",scrollframe.size.height);
    NSLog(@"scrollview height = %f", scrollView.frame.size.height);
    [pick setFrame:CGRectOffset([pick frame], 0, -220)];
    [UIView commitAnimations];

This is console log..

2011-06-08 10:43:31.316 AESDirect[281:207] scrollframe.height=416.000000, pick height=216.000000
2011-06-08 10:43:31.316 AESDirect[281:207] scroll height = 200.000000
2011-06-08 10:43:31.317 AESDirect[281:207] scrollview height = 200.000000
before scrolling

after scrolling

  • 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-05-23T02:15:39+00:00Added an answer on May 23, 2026 at 2:15 am

    This might help you:

    [scrollframe setContentOffset:CGPointMake(scrollframe.contentOffset.x, scrollframe.contentOffset.y-100)];
    

    You can call the above code via the same function from where you are calling the pickerView. So this way you don’t have to change the height of the scrollview.

    Your code should be like this then:

           UIView *contentView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, 320, 460)];
    [contentView setBackgroundColor:[UIColor clearColor]];
    self.view = contentView;
    
    UIScrollView *horizontalScroll = [[UIScrollView alloc] initWithFrame:CGRectMake(0, 0, 320, 460)];
    [horizontalScroll setBackgroundColor:[UIColor blackColor]];
    [horizontalScroll setDelegate:self];
    [contentView addSubview:horizontalScroll];
    
    UIPickerView *tempPicker = [[UIPickerView alloc] initWithFrame:CGRectMake(0, 220, 320, 100)];
    [tempPicker setHidden:YES];
    [contentView addSubview:tempPicker];
    

    Make all three of them as Global in .h file and then you will have better control on their behavior. Your picker view is moving along with other items of scroll view because you might have add picker view as subview on your scroll view.

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

Sidebar

Related Questions

i have an array of some values and i want to dynamically create textfields
I have several items textfields, labels, and images on a UIScrollView. Is there a
I have multiple textfields in a view (not a scrollview); 2 in particular are
Actually i want to implement swipe left and right in UIScrollview. i have scrollview
I have 1 scrollview that contain 18 buttons. 1) when a user taps on
i have a scrollView. i want it to scroll only in one direction(VERTICAL). Is
I have a ScrollView which has two hidden images, one at the top and
I am creating some 6 to 10 textfields dynamically and also some labels dynamically.I
I have a scrollview and its initialize as this ; scrollV = [[UIScrollView alloc]
I have an application with Textfields in my MainViewController.m file. There is also a

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.