question

Borisoprit-6789 avatar image
0 Votes"
Borisoprit-6789 asked ·

Slide to max page hight

I have a slider and can fill in the slide length .

For example 300 or 400 .

In the code the length 550 what to fill in for the whole screen ?




 var mainDisplayInfo = DeviceDisplay.MainDisplayInfo;
    
    
             if (MyDraggableView.Height == 0)
             {
                 Action<double> callback = input => MyDraggableView.HeightRequest = input;
                 double startHeight = 0;
                 double endHeight = mainDisplayInfo.Height / 4;
                 uint rate = 32;
                 uint length = 550;
                 Easing easing = Easing.CubicOut;
                 MyDraggableView.Animate("anim", callback, startHeight, endHeight, rate, length, easing);
             }
             else
             {
                 Action<double> callback = input => MyDraggableView.HeightRequest = input;
                 double startHeight = mainDisplayInfo.Height / 4;
                 double endiendHeight = 0;
                 uint rate = 32;
                 uint length = 550;
                 Easing easing = Easing.SinOut;
                 MyDraggableView.Animate("anim", callback, startHeight, endiendHeight, rate, length, easing);
    
             }
dotnet-xamarinforms
· 1
10 |1000 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Hi @Borisoprit-6789 ,what's the MyDraggableView? Could you please post more code snippets or a basic demo to github or onedriver so that we can help you better?

0 Votes 0 ·

1 Answer

Borisoprit-6789 avatar image
0 Votes"
Borisoprit-6789 answered ·

The MyDraggableView is the name of the slider , and this is the code of the slider itself in xaml.
This part is sliding up


 <PanCake:PancakeView  VerticalOptions="EndAndExpand" BackgroundColor="{StaticResource Kleurlichtgroengrijs}"  x:Name="MyDraggableView" CornerRadius="25,25,0,0" HorizontalOptions="FillAndExpand" HeightRequest="0">
                     <ScrollView>
                         <Grid>
                             <Grid.RowDefinitions>
                                 <RowDefinition Height="25"/>
                                 <RowDefinition Height="Auto"/>
                                 <RowDefinition Height="Auto"/>
                                 <RowDefinition Height="Auto"/>
                                 <RowDefinition Height="Auto"/>
                                 <RowDefinition Height="Auto"/>
                                 <RowDefinition Height="Auto"/>
                                 <RowDefinition Height="Auto"/>
                                 <RowDefinition Height="Auto"/>
                                 <RowDefinition Height="Auto"/>
                             </Grid.RowDefinitions>
    
                             <Grid Grid.Row="0">
                                 <BoxView HeightRequest="2"  Margin="10" VerticalOptions="CenterAndExpand" HorizontalOptions="CenterAndExpand" BackgroundColor="Gray" WidthRequest="90"/>
                                 <Grid.GestureRecognizers>
                                     <TapGestureRecognizer Tapped="TapGestureRecognizer_Tapped"/>
                                 </Grid.GestureRecognizers>
                             </Grid>
    
                             <StackLayout Margin="0,20,0,20" Grid.Row="1" VerticalOptions="CenterAndExpand">
                                 <Label Text="Highscore" TextColor="{StaticResource Backgroundoverall }"
                                           HorizontalOptions="Center"
                                             FontSize="Medium"                   
                        Grid.Row="2"/>
    
                                 <CollectionView
    
                     x:Name="lstPersons2"   Grid.Row="3"
                             ItemsSource="{Binding personList}"
                                    Margin="05,0"
                                  SelectionChanged="lstPersons_SelectionChanged"
                      SelectionMode="Single"
                                 
                                    HeightRequest="150"
                                     WidthRequest="80"
                                    VerticalOptions="FillAndExpand"
                                    HorizontalScrollBarVisibility="Never" >
    
                                     <CollectionView.ItemTemplate>
                                         <DataTemplate>
                                             <Grid Padding="0,5,0,5" BackgroundColor="#ff9500"  >
    
                                                 <Grid.RowDefinitions>
                                                     <RowDefinition Height="25" />
                                                     <RowDefinition Height="1" />
                                                 </Grid.RowDefinitions>
                                                 <Grid.ColumnDefinitions>
                                                     <ColumnDefinition Width="30" />
                                                     <ColumnDefinition Width="200" />
                                                     <ColumnDefinition Width="50" />
                                                 </Grid.ColumnDefinitions>
                                                 <Frame Grid.Row="0" Grid.RowSpan="2" CornerRadius="5"
                        Grid.Column="1" BackgroundColor="#e3edf7" HeightRequest="12"   />
    
                                                 <Label Text="{Binding Name}"  Grid.Row="0" TranslationY="0" TranslationX="3"
                        Grid.Column="1"  
                                    HorizontalOptions="Start" VerticalOptions="Center" TextColor="#ff15616d" FontSize="18"  />
    
                                                 <Frame Grid.Row="0" CornerRadius="60" Grid.RowSpan="2"
                        Grid.Column="2" BackgroundColor="{StaticResource Kleuroranjebruin}" HeightRequest="12"   />
    
                                                 <Label Text="{Binding Score}" 
                                    Grid.Row="0"  
                        Grid.Column="3" HorizontalTextAlignment="Center" TranslationY="2" TranslationX="-45"   HorizontalOptions="Start" VerticalOptions="Center" TextColor="{StaticResource Kleurgroengrijs}" FontSize="Medium" />
    
    
                                             </Grid>
                                         </DataTemplate>
                                     </CollectionView.ItemTemplate>
                                 </CollectionView>
                             </StackLayout>
    
                             <Grid Grid.Row="3">
                                 <Grid.ColumnDefinitions>
                                     <ColumnDefinition Width="3*"/>
                                     <ColumnDefinition Width="4*"/>
                                     <ColumnDefinition Width="3*"/>
                                 </Grid.ColumnDefinitions>
    
                             </Grid>
                         </Grid>
    
                     </ScrollView>
                 </PanCake:PancakeView>


And this is the slider , but i want to slide it al the way up , on every phone .





73005-img-2868.jpg


[1]: /answers/storage/attachments/73043-img-2867.jpg


img-2867.jpg (84.7 KiB)
img-2868.jpg (61.5 KiB)
· 1 ·
10 |1000 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Thanks for sharing the code snippets, I’ll try myself and get back to you as soon as I have an update. Much appreciated for your patience.

0 Votes 0 ·