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

Is It possible to have a editable Entry inside List ViewCell ? Entry view is not focused in Android.

$
0
0

I have a view cell with Edit menu item. On Edit click i'm toggling the visibility of Entry text input to be editable by user. But my problem is the softkeyboard is not appearing. I'm not seeing focus set inside text input/Entry.

Like this:

<ListView x:Name="planList" ItemsSource="{x:Static local:SampleData.PLAN_DATA}" RowHeight="150" HorizontalOptions="FillAndExpand">
    <ListView.ItemTemplate>
        <DataTemplate>
            <ViewCell>
                <ViewCell.ContextActions>
                    <MenuItem Clicked="OnEditClick" Text="Edit" CommandParameter="{Binding .}"/>
                    <MenuItem Clicked="OnDeleteClick" Text="Delete" IsDestructive="True" />
                </ViewCell.ContextActions>
                <ViewCell.View>
                    <StackLayout Orientation="Vertical"  HorizontalOptions="Start" VerticalOptions="FillAndExpand">
                        <!--Non Editable State-->
                        <StackLayout Orientation="Horizontal" Spacing="28" IsVisible="{Binding isNotSaveState}">
                            <Frame  WidthRequest="130" HeightRequest="50" BackgroundColor="#151617" HorizontalOptions="Start">
                                <Label Text="{Binding from}" TextColor="#ff9600" FontSize="Medium" FontFamily="Helvetica"/>
                            </Frame>
                        </StackLayout>
                        <!--Editable State-->
                        <StackLayout Orientation="Horizontal" Spacing="0"  IsVisible="{Binding isSaveState}">
                            <StackLayout Orientation="Horizontal" Spacing="5">
                                <Label Text="From" TextColor="#838288"  FontSize="Medium" FontFamily="Helvetica"/>
                                <!-- ERROR: Softkeyboard Not Focusing -->
                                <Entry Text="" BackgroundColor="Red"/>
                            </StackLayout>
                            <Button Text="Save" BackgroundColor="Green" CommandParameter="{Binding .}" Clicked="onSaveClick" />
                        </StackLayout>
                    </StackLayout>
                </ViewCell.View>
            </ViewCell>
        </DataTemplate>
    </ListView.ItemTemplate>
</ListView>

Is it correct to do like this or is there any other way to solve this problem?


Viewing all articles
Browse latest Browse all 58056

Trending Articles



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