WindowsPhone ListPicker does not "push down" other elements - xaml

Code:
<ScrollView>
<StackLayout VerticalOptions="Start">
<local:myListPicker x:Name="LP"></local:myListPicker>
<Label Text="Push me"></Label>
<Label Text="DOWN"></Label>
</StackLayout>
</ScrollView>
I added four Items to the ListPicker, when I tap on it, it opens, but only the first one can be seen, since it does not "push away" the two labels under it.
It looks like the ListPicker is "behind" the two labels, why is that and how to fix?
Additinol Info:
ExpansionMode equals ExpansionMode.ExpansionAllowed.
With 5 or more Items in the List it gets fullscreen (which is totally OK)

Related

Maui framework doesn't display sliders correctly

I have been dipping my toes in the .NET Maui framework, but unfortunately so far it has been quite disappointing. There seem to be multiple errors related to Shell (title view not working properly) and controls themselves. I have the following main page xaml file:
<ContentPage xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
x:Class="MauiApp1.MainPage">
<StackLayout Background="#111111" >
<Frame HasShadow="True" Margin="10" CornerRadius="10" BackgroundColor="#222222">
<StackLayout Spacing="30">
<Grid ColumnDefinitions="30,*">
<Label Text="R" FontSize="Medium" TextColor="White" />
<Slider GridLayout.Column="1" MinimumTrackColor="Red" ThumbColor="Red" MaximumTrackColor="#AAAAAA" />
</Grid>
<Grid ColumnDefinitions="30,*">
<Label Text="G" FontSize="Medium" TextColor="White" />
<Slider GridLayout.Column="1" MinimumTrackColor="#7FFF00" ThumbColor="#7FFF00" MaximumTrackColor="#AAAAAA" />
</Grid>
</StackLayout>
</Frame>
</StackLayout>
</ContentPage>
which is just a stack layout with a single frame that houses two sliders with labels. However, the two sliders seem to have a predefined width, as they are not filling the remaining space:
As soon as I add anything to any of the controls in the xaml while the app is running, for example a green background to the first grid, both sliders resize to the correct size:
However, when I reload the application with this change, the sliders go back to the wrong size:
There are additional issues that I encountered as well, when placing this content page as a flyout item in the shell where android behaviour was as described here, but additionally the Sliders are not interactable in Windows version. In this example with a clean project they do work in Windows version.
Try with any third-party packages like syncfusion, etc. to meet your requirements.

Two Buttons in Stack Layout, only first one works

In my XAML Page, I have nested stacklayouts, and in an end nest, I have two buttons. Only one of them will click (the first one). I have made it real simple. Only Color is different. When I put the red one on top, it will click. When I put the green one on top, it will click. Why both do not click, why only the first one? I need both to click.
<StackLayout Orientation="Horizontal" VerticalOptions="Center" HorizontalOptions= "CenterAndExpand" HeightRequest="75" IsVisible="{Binding IsUpcomingTrip}">
<StackLayout Orientation="Vertical" HorizontalOptions= "CenterAndExpand">
<StackLayout Orientation="Horizontal" VerticalOptions="Start" HorizontalOptions= "FillAndExpand" HeightRequest="25">
</StackLayout>
<Button x:Name="btnCancelTrip1" Text="CANCEL TRIP" TextColor="WhiteSmoke" BackgroundColor="Red"
HorizontalOptions="FillAndExpand" Clicked="Test_Click">
</Button>
<Button x:Name="btnUpcomingTrip" Text=" REGISTER YOUR UPCOMING TRIP " TextColor="WhiteSmoke" BackgroundColor="DarkGreen"
HorizontalOptions="FillAndExpand" Clicked="Test_Click">
</Button>
</StackLayout>
</StackLayout>
I expect that both buttons should be clickable. Only the first one is clickable. When red on top, it is enabled/ clickable. When green on top, it is enabled/clickable. But not both.
The solution is to remove one stack layer. The buttons will work fine if there are two nested stack layers, but not when there are three (In which case only the first one works).
If you really need a 3rd layer, then use Grid for the 3rd layer instead of StackLayout.

Xamarin Image on Button is crashing

So I have a Button where I want to add an image, but the app is crashing when the view gets loaded (view doesn't even show up, using Xamarin Live Player). If I create an extra image field the image shows up.
Here is the code:
<Image Grid.Row="3" Source="trash.png"></Image>
<Button Grid.Row="4" Image="trash.png" ></Button>
Any ideas why?

Search Bar inside ViewCell doesn't allow input from keyboard in Android

I'm using Xamarin.Forms and I wanted to put some controls inside a TableView. One of them is a SearchBar, which is inside a ViewCell.
I tested this one in my Android phone and it doesn't allow me to input from keyboard, I tap on it and it doesn't bring keyboard.
Perhaps is bug or I am using the wrong Cell type for a SearchBar.
<ContentPage.Content>
...
<TableView>
<TableRoot>
<TableSection Title="Cliente">
<ViewCell>
<SearchBar x:Name="txtBusquedaCliente" Placeholder="Seleccione..." />
</ViewCell>
<SwitchCell x:Name="swFormato" Text="Shor Format: " ></SwitchCell>
</TableSection>
...
</TableView>
...
</ContentPage.Content>

Native Script ScrollView and AbsoluteLayout

Im new to NS and I have a project. I want a Button floating inside a ScrollView.
<ScrollView>
<StackLayout orientation="vertical">
<AbsoluteLayout >
<Button top="0" left="0" right="0" text="Test" style="font-size: 10; margin:5; " />
</AbsoluteLayout>
<Label text="Trending Now: " cssClass="trending-label" />
<Repeater items="{{ categories }}">
<Repeater.itemTemplate>
.
.
.
</Repeater.itemTemplate>
</Repeater>
</StackLayout>
</ScrollView>
But its not working. The Button is also scrolling. I want the Button to be floating on ScrollView. Thank you.
The reason why the button is scrolling together with the other items is that everything is situated in a ScrollView. In order to have only the Label and the Repeater scrolling, the Button should be placed outside of it.
Another thing I have noticed is that on the Button, simultaneously are applied left and right alignment, which might cause a problem.
I made a possible implementation of the float button, which you can check here.