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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T20:34:48+00:00 2026-06-13T20:34:48+00:00

I need to draw dynamic images on UIScrollView for this i use, MKHorizion menu

  • 0

I need to draw dynamic images on UIScrollView for this i use, MKHorizion menu (A subclass of Scroll view). Now i add Subview images on scrollview. Loop worked perfectly for adding subview on scrollview. Now in My parent class I need to touch scroll view for updated data. If i didn’t touch then it is not showing updated data. Below is code

-(void) reloadData
{
    [self deleteAlliTem];
    self.itemCount = [dataSource numberOfImagesForMenu:self];
    self.backgroundColor = [dataSource backgroundColorForImage:self];

    UIFont *buttonFont = [UIFont boldSystemFontOfSize:15];
    int buttonPadding = 0;

    int tag = kButtonBaseTag;    
    int xPos = kLeftOffset;

    for(int i = 0 ; i < self.itemCount; i ++)
    {
      NSLog(@"*************************************************************");
        NSMutableDictionary *dictData=[dataSource horizMenuImage:self dictForItmeAtIndex:i];

        NSString *title=[dictData valueForKey:@"name"] ? [dictData valueForKey:@"name"] :  @"";

        UIImage* imageItem= [UIImage imageWithData:[Base64 decode:[dictData valueForKey:@"img"]]];
        int buttonWidth = 95;

         UIButton *customButton = [UIButton buttonWithType:UIButtonTypeCustom];
        [customButton setTitle:title forState:UIControlStateNormal];
        customButton.titleLabel.font = buttonFont;
        [customButton setBackgroundImage:[UIImage imageNamed:@"addFriendStrip.png"] forState:UIControlStateNormal];
        [customButton setBackgroundImage:[UIImage imageNamed:@"addFriendStrip.png"] forState:UIControlStateSelected];
         customButton.tag = tag++;
        [customButton addTarget:self action:@selector(buttonTapped:) forControlEvents:UIControlEventTouchUpInside];
         customButton.frame = CGRectMake(xPos, 70, buttonWidth + buttonPadding, 25);
        customButton.contentHorizontalAlignment = UIControlContentHorizontalAlignmentLeft;
        customButton.contentVerticalAlignment = UIControlContentVerticalAlignmentCenter;

        customButton.titleEdgeInsets =UIEdgeInsetsMake(0, 10,0, 0);

        customButton.titleLabel.font = [UIFont fontWithName:@"Overlock-Bold" size:16];
        [customButton setTitleColor:[UIColor colorWithRed:255.0/255.0 green:255.0/255.0 blue:255.0/255.0 alpha:1] forState:UIControlStateNormal];
        [customButton setTitleColor:[UIColor colorWithRed:255.0/255.0 green:255.0/255.0 blue:255.0/255.0 alpha:1] forState:UIControlStateSelected];

         UIImageView* itemImageView = [[UIImageView alloc] initWithImage:imageItem];
        itemImageView.tag = 200 + customButton.tag;
        [itemImageView setFrame:CGRectMake(xPos, 0, buttonWidth + buttonPadding, 95)];
        [self addSubview:itemImageView];
        [itemImageView release];
        itemImageView = nil;
        [self addSubview:customButton];

        xPos += buttonWidth;
         xPos += buttonPadding;
        if (i != self.itemCount-1){
            xPos += 2.5; //5;  // Richa
        }
    }
    self.contentSize = CGSizeMake(xPos, 95);
     NSLog(@"############################################################################ - %d",[[self subviews] count]);
    [self scrollRectToVisible:CGRectMake(1, 0, self.frame.size.width, self.frame.size.height) animated:YES];
    }

Please Help me to sort out this. Why do i needed to touch scroll view ? Do i need to override other methods ?

  • 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-13T20:34:49+00:00Added an answer on June 13, 2026 at 8:34 pm

    Did you check it is on main thread ? may be you are using GCD Queue thats why it is not updating till touch.

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

Sidebar

Related Questions

A need to draw an X in a View using Shapes , but the
I need use a progress bar with the pbstMarquee style, I read this question
I need to draw charts in my application. For that i use RGraph (
Now I'm doing a project which need draw multiple pie charts with text. Can
Hey, Like in title can someone answer this simple question? I need draw line
I need to draw a gridded image using opengl. I've read that images created
The documentation about this is really confusing. I simply need to add rectangels to
I need to draw a rectange,circle and line and then animate them(press left ->
I need to draw vertical and horizontal rectangle / bands (like in Gantt charts)
I need to draw simple alpha maps in xna which depends on current game

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.