Picker hidden behind listview, On Pad and Iphone

MeteMete Member ✭✭

        <StackLayout Orientation="Horizontal">
        <Label  Text="Select Facility"  Style="{StaticResource BlueLabel}"/>
         <Picker x:Name="FacilityPicker" Style="{StaticResource BlueLabel} "
                ItemsSource="{Binding Facilities}"
                ItemDisplayBinding="{Binding value}"
                SelectedItem="{Binding SelectedFacility}"/>
        <Label  x:Name="FacilitySelected" Text="{Binding ChangeFacility}"  Style="{StaticResource BlueLabel}"/>            
    </StackLayout>        

    <!--Header Content-->        
    <Grid x:Name="HeaderGrid" RowSpacing="3" ColumnSpacing="1">
        <Grid.RowDefinitions>
            <RowDefinition Height="*" />
            <RowDefinition Height="10"/>
            <RowDefinition Height="auto" />
            <RowDefinition Height="auto" />
        </Grid.RowDefinitions>
  </Grid>    
    <!--End of Header Content-->

    <!--Data Content-->
    <Local:CustomListView ItemsSource="{Binding EnvItemsList}"
                  HasUnevenRows="True"                      
                  ItemClickCommand="{Binding ItemClickCommand}">
        <Local:CustomListView.ItemTemplate>
            <DataTemplate>
                <ViewCell>
                    <StackLayout Orientation="Horizontal">
                        <Grid BackgroundColor="Purple" 
                              Padding="10" RowSpacing="20" Margin="10">
                            <Grid.RowDefinitions>
                                <RowDefinition Height="80"/>
                            </Grid.RowDefinitions>
                            <Grid.ColumnDefinitions>
                                <ColumnDefinition Width="80"/>
                            </Grid.ColumnDefinitions>
                            <Label Text="{Binding EnvAudititemID}"
                                   FontSize="50"
                                   TextColor="White" Grid.Row="0" Grid.Column="0"
                                   HorizontalOptions="Center"
                                   VerticalOptions="Center"/>
                        </Grid>
                        <StackLayout Orientation="Vertical">
                            <Label Text="{Binding ItemA}"
                                   FontSize="24"
                                   TextColor="Black"/>
                            <Label Text="{Binding ItemB}"                            
                                   FontSize="20"
                                   TextColor="Gray"/>
                        </StackLayout>
                    </StackLayout>
                </ViewCell>
            </DataTemplate>
        </Local:CustomListView.ItemTemplate>
    </Local:CustomListView>
</StackLayout>
Tagged:

Answers

  • M_Shah04M_Shah04 USMember ✭✭✭

    You can use Grid with three rows having Auto height and use it for picker, Header and list data content.
    Then it will always place control in proper positions.
    Hope this may solve your issue.

  • MeteMete Member ✭✭

    Nope that did not work either.


    <Grid.RowDefinitions>



    </Grid.RowDefinitions>
    <Grid.ColumnDefinitions>

    </Grid.ColumnDefinitions>

                <Label  Text=" Facility: "  Style="{StaticResource BlueLabel}" 
                        HorizontalOptions="Center" VerticalOptions="Center"
                        Grid.Row="0" Grid.Column="0"/>
    
                <Picker x:Name="FacilityPicker" Style="{StaticResource BlueLabel} "
                        ItemsSource="{Binding facilitiesList}"                   
                        SelectedItem="{Binding SelectedFacility}" HorizontalOptions="FillAndExpand"
                        Grid.Row="1" Grid.Column="0"/>
                <Label  x:Name="FacilitySelected" Text="{Binding ChangeFacility}"  
                        Style="{StaticResource BlueLabel}" 
                        HorizontalOptions="Center"
                        Grid.Row="2" Grid.Column="0"/>
             </Grid>
    

    Code behind...
    List facilitiesList = new List
    {
    new Facility {FacilityID = 1, FacilityName="Stirling Station" },
    new Facility {FacilityID = 1, FacilityName="Madison" },
    new Facility {FacilityID = 1, FacilityName="Elberon Station" },
    new Facility {FacilityID = 1, FacilityName="Edison lands Garage" },
    new Facility {FacilityID = 1, FacilityName="Meadowlands Garage" },
    new Facility {FacilityID = 1, FacilityName="Belmar Station" },
    new Facility {FacilityID = 1, FacilityName="Asbury Park Station" },
    new Facility {FacilityID = 1, FacilityName="Avenel Station" },
    };

  • M_Shah04M_Shah04 USMember ✭✭✭
    edited November 2018

    @Mete said:
    Nope that did not work either.


    <Grid.RowDefinitions>



    </Grid.RowDefinitions>
    <Grid.ColumnDefinitions>

    </Grid.ColumnDefinitions>

                <Label  Text=" Facility: "  Style="{StaticResource BlueLabel}" 
                        HorizontalOptions="Center" VerticalOptions="Center"
                        Grid.Row="0" Grid.Column="0"/>
                
                <Picker x:Name="FacilityPicker" Style="{StaticResource BlueLabel} "
                        ItemsSource="{Binding facilitiesList}"                   
                        SelectedItem="{Binding SelectedFacility}" HorizontalOptions="FillAndExpand"
                        Grid.Row="1" Grid.Column="0"/>
                <Label  x:Name="FacilitySelected" Text="{Binding ChangeFacility}"  
                        Style="{StaticResource BlueLabel}" 
                        HorizontalOptions="Center"
                        Grid.Row="2" Grid.Column="0"/>
             </Grid>
    

    Code behind...
    List facilitiesList = new List
    {
    new Facility {FacilityID = 1, FacilityName="Stirling Station" },
    new Facility {FacilityID = 1, FacilityName="Madison" },
    new Facility {FacilityID = 1, FacilityName="Elberon Station" },
    new Facility {FacilityID = 1, FacilityName="Edison lands Garage" },
    new Facility {FacilityID = 1, FacilityName="Meadowlands Garage" },
    new Facility {FacilityID = 1, FacilityName="Belmar Station" },
    new Facility {FacilityID = 1, FacilityName="Asbury Park Station" },
    new Facility {FacilityID = 1, FacilityName="Avenel Station" },
    };

    Nope, You have done it wrong, What I was suggesting is, Take three Rows of Grid same as you have taken then:
    For 1st row: StackLayout that contains all 3 controls.
    For 2nd row: Header content Grid
    For 3rd row: Local:CustomListView

    So in the main grid all your layout will be placed, and any of them wouldn't be hide behind any control.

    You should mention user name like @M_Shah04 , as I didn't get your comment and not able to answer your question, was just checking randomly and got this post.

Sign In or Register to comment.