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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 21, 20262026-05-21T20:45:34+00:00 2026-05-21T20:45:34+00:00

I have a single image view, and I set other image views on it

  • 0

I have a single image view, and I set other image views on it and put them in different locations. I want to apply FLIP ANIMATION on mage view. How can do it? when if(i==1) then my imageview is flipped. img1 is my image view and I want to identify it. I allocate 52 images in `imagearr

My code:

-(void)setCards
{

    int k=0;
    CGFloat dx = self.view.frame.size.width/2;
    CGFloat dy = self.view.frame.size.height/2;

    int cnt = [imagearr count];


    for (int j=1; j<3; j++)            // Number of cards
    {
        for (int i=1; i<5; i++)         // Number of players
        {
            int rnd = (arc4random() % cnt)-1;   
            UIImage *img = [imagearr objectAtIndex:rnd];
            UIImageView *img1 = [[UIImageView alloc] initWithImage:img];

            CGRect frame = img1.frame;
            frame.size.width = frameX;
            frame.size.height = frameY;
            [img1 setFrame:frame];
            [img1 setTag:k+i];

            [UIView beginAnimations:@"Move" context:nil];
            [UIView setAnimationDuration:0.50];
            if (i==1)
            {
                [img1 setCenter:CGPointMake(dx+100, dy+(j*15))];

            }
            if (i==2) 
            {
                [img1 setCenter:CGPointMake(dx+(j*15), dy+60)];
            }
            if (i==3) 
            {
                [img1 setCenter:CGPointMake(dx-130, dy-(j*15))];
            }
            if (i==4) 
            {
                [img1 setCenter:CGPointMake(dx-(j*20), dy-95)];
            }

            [self.view addSubview:img1];
            [UIView commitAnimations];
            [img1 release];

        }
        k=k+10;      
    }


}

-(void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event
{ 
    UITouch *touch = [[event allTouches] anyObject];
    int t = [touch view].tag;


}

I still can’t identify a specific imageview. Please help me to solve this problem.

  • 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-21T20:45:35+00:00Added an answer on May 21, 2026 at 8:45 pm

    I think you should take a look at the Apple sample project GeekGameBoard. It implements a solitaire game and you will be able to learn how to select CALayers* representing cards, drag them around, and have them interact with each other.


    *Which will be both easier and probably better from a performance perspective than using views.

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

Sidebar

Related Questions

No related questions found

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.