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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T01:08:16+00:00 2026-05-22T01:08:16+00:00

Okay so I have a subclassed UIScrollView with some subviews inside it, when the

  • 0

Okay so I have a subclassed UIScrollView with some subviews inside it, when the device orientation changes I want to update the position of the subviews inside so that they fit the new orientation.

When I just updated the positions of the subviews and then went to scroll I noticed that the scroll handle was ginormous… My loop that went through all of the subviews and updated their frames also set the frame of the scroll handle…

So to get around this.. whenever I added subviews I set a tag on them. When the orientation changed I had a condition around my set frame which checked if the tag on the view matched the subviews I added. If yes then set the frame…

int i = 0;

for (UIView *gridViewItem in self.subviews) {

    if (gridViewItem.tag == GRID_CELL) {
        gridViewItem.frame = [self calculateCellPosition:i];
    }

    i++;

}

But now I want to detect a touch on the subviews, and the easiest way I can think of doing that is by using the tag property so I know which subview is being tapped… However the tag is currently being used to help me distinguish the scroll handle from the other subviews…

When i logged out the subviews of my UIScrollView I got this:

2011-05-08 16:07:56.266 XXXXXX[2096:207] (
"<UIView: 0x5a0d3f0; frame = (16 16; 135 105); clipsToBounds = YES; tag = 1; layer = <CALayer: 0x5a09250>>",
"<UIView: 0x5a19d70; frame = (167 16; 135 105); clipsToBounds = YES; tag = 1; layer = <CALayer: 0x5a17660>>",
"<UIView: 0x5a1d4f0; frame = (16 137; 135 105); clipsToBounds = YES; tag = 1; layer = <CALayer: 0x5a1d520>>",
"<UIView: 0x5a1e300; frame = (167 137; 135 105); clipsToBounds = YES; tag = 1; layer = <CALayer: 0x5a1e330>>",
"<UIView: 0x5a1e4f0; frame = (16 258; 135 105); clipsToBounds = YES; tag = 1; layer = <CALayer: 0x5a1e520>>",
"<UIView: 0x5a1f320; frame = (167 258; 135 105); clipsToBounds = YES; tag = 1; layer = <CALayer: 0x5a1f350>>",
"<UIView: 0x5a20120; frame = (16 379; 135 105); clipsToBounds = YES; tag = 1; layer = <CALayer: 0x5a20150>>",
"<UIView: 0x5a20fb0; frame = (167 379; 135 105); clipsToBounds = YES; tag = 1; layer = <CALayer: 0x5a20fe0>>",
"<UIView: 0x5a21dd0; frame = (16 500; 135 105); clipsToBounds = YES; tag = 1; layer = <CALayer: 0x5a21e00>>",
"<UIView: 0x5a22bb0; frame = (167 500; 135 105); clipsToBounds = YES; tag = 1; layer = <CALayer: 0x5a22be0>>",
"<UIView: 0x5a239a0; frame = (16 621; 135 105); clipsToBounds = YES; tag = 1; layer = <CALayer: 0x5a239d0>>",
"<UIView: 0x5a247b0; frame = (167 621; 135 105); clipsToBounds = YES; tag = 1; layer = <CALayer: 0x5a247e0>>",
"<UIView: 0x5a20f30; frame = (16 742; 135 105); clipsToBounds = YES; tag = 1; layer = <CALayer: 0x5a20f80>>",
"<UIView: 0x5a26460; frame = (167 742; 135 105); clipsToBounds = YES; tag = 1; layer = <CALayer: 0x5a26490>>",
"<UIView: 0x5a27220; frame = (16 863; 135 105); clipsToBounds = YES; tag = 1; layer = <CALayer: 0x5a27250>>",
"<UIView: 0x5a20dd0; frame = (167 863; 135 105); clipsToBounds = YES; tag = 1; layer = <CALayer: 0x5a28080>>",
"<UIView: 0x5a28e60; frame = (16 984; 135 105); clipsToBounds = YES; tag = 1; layer = <CALayer: 0x5a28e90>>",
"<UIView: 0x5a29c50; frame = (167 984; 135 105); clipsToBounds = YES; tag = 1; layer = <CALayer: 0x5a29c80>>",
"<UIView: 0x5a2aa60; frame = (16 1105; 135 105); clipsToBounds = YES; tag = 1; layer = <CALayer: 0x5a2aa90>>",
"<UIView: 0x5a2b870; frame = (167 1105; 135 105); clipsToBounds = YES; tag = 1; layer = <CALayer: 0x5a2b8a0>>",
"<UIView: 0x5a255a0; frame = (16 1226; 135 105); clipsToBounds = YES; tag = 1; layer = <CALayer: 0x5a255f0>>",
"<UIView: 0x5a262f0; frame = (167 1226; 135 105); clipsToBounds = YES; tag = 1; layer = <CALayer: 0x5a2d610>>",
"<UIView: 0x5a2e3c0; frame = (16 1347; 135 105); clipsToBounds = YES; tag = 1; layer = <CALayer: 0x5a2e3f0>>",
"<UIView: 0x5a2f1d0; frame = (167 1347; 135 105); clipsToBounds = YES; tag = 1; layer = <CALayer: 0x5a2f200>>",
"<UIView: 0x5a2ffc0; frame = (16 1468; 135 105); clipsToBounds = YES; tag = 1; layer = <CALayer: 0x5a2fff0>>"

)

All of the subviews have my tag on it! I can’t see the scroll handle? Does anyone know a way of identifying the scroll handle without using a tag like I have?

Your help will be much appreciated! Thanks!

  • 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-22T01:08:17+00:00Added an answer on May 22, 2026 at 1:08 am

    I probably wouldn’t sub-class UIScrollView for this. Add a single UIView to UIScrollView and add your cells to that view. Then always work with that view. No need for tags and doesn’t interfere with UIScrollViews inner workings. Scrolling should work as long as the size of your content view reflects the cells inside it.

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

Sidebar

Related Questions

I have the following arrays in PHP (okay they are a bit bigger but
Okay, I have this program and I don't want more than one instance of
Okay I have this RewriteRule which is supposed to redirect any request for the
Okay so I have the following Code which appends a string to another in
Okay so I have a scenario similar to the below code, I have a
Okay here's the program I have typed up(stdio.h is included also): /* function main
Okay, I have a FormView with a couple of child controls in an InsertItemTemplate.
Okay, I have ran in to a problem with VB.NET. So all those defenders
Okay, this is just a crazy idea I have. Stack Overflow looks very structured
Okay this is a real headscratcher. I have an application which calls a web

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.