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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T02:08:09+00:00 2026-05-26T02:08:09+00:00

I have a grid of UIViews that each have a touch event attached. When

  • 0

I have a grid of UIViews that each have a touch event attached. When a UIView is touched I would like to fade all of its siblings.

Does anyone have any direction to give on this? Can the fading siblings be handled by the UIView that was touched or should the view controller fade the siblings?

EDIT: Figured it out:

- (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event {

    for (UIView *subview in [self.superview subviews]) {
        if ( subview != self ) {
            subview.layer.opacity = 0.5;
        }      
    }

    [super bringSubviewToFront:self];

}
  • 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-26T02:08:10+00:00Added an answer on May 26, 2026 at 2:08 am

    You can also do it at the UIView level. Just wrap your change to the view’s alpha inside a UIView animation block. Like this:

    - (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event
    {
      [UIView beginAnimations:nil context:NULL];  
      [UIView setAnimationDuration:0.5];
      for (UIView *subview in [self.superview subviews]) {
        if ( subview != self ) {
          [subview setAlpha:0.5];
        }      
      }
      [UIView commitAnimations];    
      [super bringSubviewToFront:self];
    
    }
    

    This should fade all subviews to half opacity over a half second. You got it sorted, but I just thought I would throw in the UIView way of achieving the same result.

    Best regards.

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

Sidebar

Related Questions

I have a custom UIView subclass that contains a grid of cells, each of
I have a grid which I would like to show extra information with RowExpander
I have grid that gets created in the code behind. Grid has columns like
I have a view hierarchy that looks something like this: UIView (A) UIView >
I have grid of thumbnail images on a form, and I would like for
I have grid like this. How to change index for each element, i.e. to
I have grid something like this: Ext.define('Exp.view.dashboard.Tv', { extend: 'Ext.grid.Panel', initComponent: function() { this.columns
I will have to implement a calendar view/controller that looks pretty much like the
i have grid that uses around 12 to 15 label when i bind it...and
Hai presently i have grid like this. <Grid Name=tGrid1 Grid.Row=0 Background=Black > </Grid> <Grid

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.