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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T21:52:20+00:00 2026-05-23T21:52:20+00:00

In one of my viewController, I have a scrollView, a UIView which contains and

  • 0

In one of my viewController, I have a scrollView, a UIView which contains and UIImageView, UITextView etc. for the scrollview here’s the code what i wrote:

    overViewScroll = [[UIScrollView alloc]initWithFrame:CGRectMake(0,0,screenFrame.size.width,screenFrame.size.height)];
        [overViewScroll setCanCancelContentTouches:NO];
        overViewScroll.pagingEnabled = YES;
        overViewScroll.clipsToBounds = NO;
        overViewScroll.indicatorStyle = UIScrollViewIndicatorStyleWhite;
        [overViewScroll setContentSize:CGSizeMake(screenFrame.size.width, screenFrame.size.height-25)];
        [overViewScroll setScrollEnabled:YES];
        [overViewScroll setAlwaysBounceVertical:YES];
        [overViewScroll setShowsVerticalScrollIndicator:YES];

UIView * completeView = [[UIView alloc]initWithFrame:CGRectMake(0,0,screenFrame.size.width,screenFrame.size.height)];
    UILabel* heading1 = [[UILabel alloc]initWithFrame:CGRectMake(5,0,310,30)];
    heading1.text = name;
    heading1.backgroundColor = [UIColor clearColor];
    UIFont * headingFont = [UIFont fontWithName:@"HelVetica" size:15];
    heading1.font = headingFont;
    [completeView addSubview:heading1];
    //NSSet * imageString = [projectHeroData valueForKey:@"imageURL"];
    NSString * urlString = @"";
    NSURL * url = [NSURL URLWithString:urlString];
    NSData * imageData = [NSData dataWithContentsOfURL:url];
    UIImage * projImage = [[UIImage alloc]initWithData:imageData];  
    UIImageView * imgView = [[UIImageView alloc]initWithFrame:CGRectMake(screenFrame.size.width/70,screenFrame.size.height/50,screenFrame.size.width-((screenFrame.size.width/70)*2),screenFrame.size.height/3)];
    imgView.image = projImage;
    imgView.backgroundColor = [UIColor blueColor];
    [completeView addSubview:imgView];

    UILabel * abstract = [[UILabel alloc]initWithFrame:CGRectMake(screenFrame.size.width/41,screenFrame.size.height/31 + screenFrame.size.height/3,screenFrame.size.width/4,screenFrame.size.height/30)];
    abstract.text = @"Abstract-";
    abstract.font = [UIFont boldSystemFontOfSize:fontSize];
    abstract.backgroundColor = [UIColor clearColor];
    [completeView addSubview:abstract];

    UILabel * lastUpdated = [[UILabel alloc]initWithFrame:CGRectMake(screenFrame.size.width/41 + screenFrame.size.width/5,screenFrame.size.height/31 + screenFrame.size.height/3,screenFrame.size.width-screenFrame.size.width/4,screenFrame.size.height/30)];
    NSString * string = modDate ;
    NSString * updated = [NSString stringWithFormat:@"Last Updated-%@",string];
    lastUpdated.text = updated;
    lastUpdated.backgroundColor = [UIColor clearColor];
    lastUpdated.font = [UIFont boldSystemFontOfSize:fontSize];
    [completeView addSubview:lastUpdated];

    UITextView * textView2 = [[UITextView alloc]initWithFrame:CGRectMake(screenFrame.size.width/70,(screenFrame.size.height/31 + screenFrame.size.height/3)+screenFrame.size.height/30,screenFrame.size.width-screenFrame.size.width/70*2,screenFrame.size.height)];
    textView2.text = abst;
    textView2.editable = NO;
    textView2.font = [UIFont systemFontOfSize:fontSize];
    textView2.backgroundColor = [UIColor clearColor];
    [completeView addSubview:textView2];

    [overViewScroll addSubview:completeView];
    [self.view addSubview:overViewScroll];

everything is addded to the UIView and UIView is added to the UIScrollView.
But the problem is its behaving weird, image is not scrolling all the way through and the text in Textview is scrolling in itself.
Please help!!

  • 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-23T21:52:21+00:00Added an answer on May 23, 2026 at 9:52 pm

    change the contentsize of your scrollview.your UIview size and uiscrollview size is same if the UIScrollview contentsize is more than its subview size then scroll will happen change the line [overViewScroll setContentSize:CGSizeMake(screenFrame.size.width, screenFrame.size.height-25)]; like this [overViewScroll setContentSize:CGSizeMake(screenFrame.size.width, (screenFrame.size.height-25)*2)];.it will allow you to horizontal scroll And by default textview having scroll property its self.

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

Sidebar

Related Questions

I have one ViewController, in this i have added one Custom UIView named as
Hey guys! I have this little problem: I have one ViewController which adds 2
So below is my code for my controller, which I have four of one
I have created two viewController classes such that one is superclass of another.i have
I would like to know which ViewController is currently the active one. in other
I've got quite a problem with UIScrollView - I have a SwitchViewController (which is
I have a paged scrollview. Each page has a viewcontroller (buttonViewController) that manages a
I have a view controller which contains a scroll view. Inside the scroll view
currently i am working in game application, Already i have one viewcontroller (and make
i have one scrollview and 4 UIviewcontrollers with xib files now i want to

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.