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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T17:41:25+00:00 2026-06-06T17:41:25+00:00

I’m trying to do the following thing – I have two version of the

  • 0

I’m trying to do the following thing –

I have two version of the same image, one colored and one black and white. I want the B&W to “Slide up” revealing the one under it.

I tried setting the height and the frame, but couldn’t get it to work like I want it to.

For example , this would be a combination of both UIImages where one is revealing the other, while not moving:

enter image description here

Any ideas? 🙂

  • 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-06T17:41:27+00:00Added an answer on June 6, 2026 at 5:41 pm

    OK, here is a different method using a mask on the grey view. I actually tested this with a blueView and a greyView, where the grey covers up the blue. Put a mask layer on the grey layer so that the grey layer is visible. Now animate the mask away from the grey layer, making the grey layer disappear without moving it, the blue shows thru where the grey disappears.

    If you want to experiment with this, create an empty project in XCode with a single view, and put this code inside viewDidLoad. That’s how I tested this.

    self.view.backgroundColor = [UIColor whiteColor];
    
    UIView* blueView = [[[UIView alloc] init] autorelease];
    blueView.backgroundColor = [UIColor blueColor];
    blueView.frame = CGRectMake(50,50,100,100);
    
    UIView* grayView = [[[UIView alloc] init] autorelease];
    grayView.backgroundColor = [UIColor grayColor];
    grayView.frame = CGRectMake(50,50,100,100);
    
    [self.view addSubview:blueView];
    [self.view addSubview:grayView];    // gray covers the blue
    
    // Create a mask to allow the grey view to be visible and cover up the blue view
    CALayer* mask = [CALayer layer];
    mask.contentsScale   = grayView.layer.contentsScale;  // handle retina scaling
    mask.frame           = grayView.layer.bounds;
    mask.backgroundColor = [UIColor blackColor].CGColor;
    grayView.layer.mask = mask;
    
    // Animate the position of the mask off the grey view, as the grey becomes unmasked,
    // that part of the grey "dissappears" and is no longer covering the blue underneath
    CABasicAnimation* a = [CABasicAnimation animationWithKeyPath:@"position"];
    a.duration  = 4;
    a.fromValue = [NSValue valueWithCGPoint:mask.position];
    CGPoint newPosition = mask.position;
    newPosition.y += mask.bounds.size.height;
    a.toValue   = [NSValue valueWithCGPoint:newPosition];
    a.timingFunction = [CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionLinear];
    [mask addAnimation:a forKey:@"colorize"];   // animate presentation
    
    mask.position = newPosition;        // update actual position
    

    Don’t forget this line at the top with the #imports:

    #import <QuartzCore/QuartzCore.h>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a French site that I want to parse, but am running into
I'm trying to convert HTML to plain text. I get many &\#8217; &\#8220; etc.
I am trying to loop through a bunch of documents I have to put
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I have a .ini file as follows: [playlist] numberofentries=2 File1=http://87.230.82.17:80 Title1=(#1 - 365/1400) Example
I am trying to find ID3V2 tags from MP3 file using jid3lib in Java.
Basically, what I'm trying to create is a page of div tags, each has
I am trying to understand how to use SyndicationItem to display feed which is
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I have just tried to save a simple *.rtf file with some websites and

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.