Coder Social home page Coder Social logo

Comments (7)

roubachof avatar roubachof commented on September 15, 2024

Yup, don't put shadows around a layout that is 12000 pixels height, you will end up with a Bitmap of 12000 pixels, and you know what will happen x)

from sharpnado.shadows.

roubachof avatar roubachof commented on September 15, 2024

as a workaround, if you are only interested by a bottom shadow for example, put a smaller transparent ContentView (maybe 50dp height) at the bottom of your layout, underneath your very looooong view, and add the shadow to this ContentView.

from sharpnado.shadows.

piotrbalut avatar piotrbalut commented on September 15, 2024

I didn't put shadows around a layout that is 12000 pixels. The container with shadows has circa 150px. Main problem is in situation when Expander is expanded, because there are 2000px.

It looks like this:

<StackLayout>
	<ScrollView>
		<StackLayout BindableLayout.ItemsSource="{Binding Items}" VerticalOptions="FillAndExpand" Margin="0">
			<BindableLayout.ItemTemplate>
				<DataTemplate>
					<StackLayout>
						<Label Text="{Binding IsLast}" x:Name="IsLast" IsVisible="False" />
						<AbsoluteLayout VerticalOptions="FillAndExpand"
												                HorizontalOptions="FillAndExpand">
							<shades:Shadows AbsoluteLayout.LayoutBounds="0,0,1,1"  AbsoluteLayout.LayoutFlags="All" CornerRadius="1">
								<Frame HasShadow="False" CornerRadius="8">
									<controls:CommandExpander Expanded="{Binding Path=IsExpanded, Mode=TwoWay}">
										<views:Expander.Header>
											<StackLayout Orientation="Horizontal">
												<!--MY CONTENT-->
											</StackLayout>
										</views:Expander.Header>
									</controls:CommandExpander>
								</Frame>
							</shades:Shadows>

							<BoxView AbsoluteLayout.LayoutBounds="0,0,2,10">
							</BoxView>
						</AbsoluteLayout>
					</StackLayout>
				</DataTemplate>
			</BindableLayout.ItemTemplate>
		</StackLayout>
	</ScrollView>
</StackLayout>

from sharpnado.shadows.

roubachof avatar roubachof commented on September 15, 2024

well 2000px bitmap is hitting OutOfMemory on your device, so it's the same issue.
same workaround apply.
Wrap a ContentView with Shadows, put it before your CommandExpander and at the end of your AbsoluteLayout, make is smaller, like
AbsoluteLayout.LayoutBounds="0,1,1,50" AbsoluteLayout.LayoutFlags="Positional,WidthProportional"

from sharpnado.shadows.

piotrbalut avatar piotrbalut commented on September 15, 2024

I don't understand how it make smaller. Look, my current view looks like this, when all expanders aren't expanded.

shadow-sample

It's (shaddow effect) possible because my frame is in shadow view. Do you suggest add shaddows on the top and the bottom of
CommandExpander? This solution will remove frame effect with corners.

Could you explain your idea?

from sharpnado.shadows.

roubachof avatar roubachof commented on September 15, 2024

Then just put a Shadows around each expander's header instead of the whole command expander.
Since Shadows caches the bitmaps, it will only use one small bitmap instead of a giant one, and you will have a nicer effect.

from sharpnado.shadows.

piotrbalut avatar piotrbalut commented on September 15, 2024

It's solution. I put Shadows only around expander header instead of all expander.

from sharpnado.shadows.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.