Bug 36121 - Layout.IsClippedToBounds affects sibling, not just children
Summary: Layout.IsClippedToBounds affects sibling, not just children
Status: RESOLVED NORESPONSE
Alias: None
Product: Forms
Classification: Xamarin
Component: Forms ()
Version: 1.4.4
Hardware: PC Windows
: --- normal
Target Milestone: ---
Assignee: Bugzilla
URL:
Depends on:
Blocks:
 
Reported: 2015-11-21 13:13 UTC by bobme981
Modified: 2017-06-17 01:44 UTC (History)
5 users (show)

Tags:
Is this bug a regression?: ---
Last known good build:

Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.


Please create a new report on Developer Community or GitHub with your current version information, steps to reproduce, and relevant error messages or log files if you are hitting an issue that looks similar to this resolved bug and you do not yet see a matching new report.

Related Links:
Status:
RESOLVED NORESPONSE

Description bobme981 2015-11-21 13:13:37 UTC
Originally posted on forums:
http://forums.xamarin.com/discussion/55764/why-does-layout-isclippedtobounds-affect-sibling-not-just-children

I've got this:
<Grid>
  <MyCustomShadowControl />
  <StackLayout IsClippedToBounds="true">
    <!-- some child controls here -->
  </StackLayout>
</Grid>

The Grid is implicitly 1x1 since no columns or rows are specified. Both children are at the same position in the Grid (0,0). The shadow control is based on NControlView and does some custom rendering of a drop shadow slightly outside its boundaries. The problem is that setting IsClippedToBounds="true" on the StackLayout blocks the shadows from being drawn by the custom control, which is a sibling.

A workaround I found is to wrap the StackLayout in a ContentView. However, it doesn't seem like this should be necessary.

Another workaround is to (obviously) avoid drawing content outside of control boundaries. It looks like we'll have to do this anyway, since iOS does not seem to support it, although it works fine on Android.
Comment 1 Samantha Houts [MSFT] 2016-12-27 20:42:04 UTC
Thank you for taking the time to submit the bug. We tried to reproduce the issue you reported but were unable given the description. If you could please attach a reproduction to the bug by starting with a clean Xamarin.Forms project and adding just the code necessary to demonstrate the issue, we would very much appreciate it.  
 
For your convenience, we have created some reproduction best practices viewable here: https://gist.github.com/jassmith/92405c300e54a01dcc6d  

Warm regards, 
Xamarin Forms Team
Comment 2 David Ortinau [MSFT] 2017-06-17 01:44:11 UTC
Because we have not received a reply to our request for more information we are closing this issue. If you are still encountering this issue, please reopen the ticket with the requested information. Thanks!