Quantcast
Channel: Xamarin.Forms — Xamarin Community Forums
Viewing all articles
Browse latest Browse all 77050

Animate ContentView - slide in/slide out

$
0
0

I have a ContentView and I have a button on my page. When i click the button i want the content view below to slide in top to bottom. Then i have another button and when that is clicked i want it to slide bottom to top away. Essentially i want to animate the process of changing visibility? How would I accomplish such a task?

     <ContentView x:Name="contentSlider" IsVisible="true"  BackgroundColor="#becedb" Margin="0" Grid.Row="2" VerticalOptions="Center">
                        <StackLayout Margin="10" Orientation="Horizontal" VerticalOptions="Center" HorizontalOptions="FillAndExpand">
                            <Slider MinimumTrackColor="White" Margin="0,0,5,0" HeightRequest="10"  MaximumTrackColor="White" x:Name="mileSlider" ValueChanged="SliderValueChanged"  Maximum="100" Minimum="10"  HorizontalOptions="FillAndExpand"></Slider>
                            <Label x:Name="lblMilesAway" Margin="0,5,0,0" TextColor="Black"  Text="{Binding Source={x:Reference mileSlider},Path=Value, StringFormat='up to {0:0} miles away'}"></Label>
                        </StackLayout>
                    </ContentView>

Viewing all articles
Browse latest Browse all 77050

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>