This example demonstrates how to enable scrollbar in SfChat to scroll messages up and down.
By default, the SfChat does not have support to show scrollbar. However, we can achieve this by enabling IsScrollBarVisible property for SfListView control.
<?xml version="1.0" encoding="utf-8" ?>
<ContentPage xmlns="http://xamarin.com/schemas/2014/forms"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
xmlns:d="http://xamarin.com/schemas/2014/forms/design"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:local="clr-namespace:GettingStarted"
xmlns:sfChat="clr-namespace:Syncfusion.XForms.Chat;assembly=Syncfusion.SfChat.XForms"
mc:Ignorable="d"
x:Class="GettingStarted.ChatPage">
<ContentPage.BindingContext>
<local:ViewModel x:Name="viewModel" />
</ContentPage.BindingContext>
<ContentPage.Content>
<StackLayout Orientation="Vertical">
<sfChat:SfChat x:Name="sfChat"
Messages="{Binding Messages}"
CurrentUser="{Binding CurrentUser}">
</sfChat:SfChat>
</StackLayout>
</ContentPage.Content>
</ContentPage>
public partial class ChatPage : ContentPage
{
public ChatPage()
{
InitializeComponent();
(this.sfChat.GetType().GetRuntimeProperties().FirstOrDefault(x => x.Name.Equals("ChatListView")).GetValue(this.sfChat) as SfListView).IsScrollBarVisible = true;
}
}
- Visual Studio 2017 or Visual Studio for Mac.
- Xamarin add-ons for Visual Studio (available via the Visual Studio installer).
If you are facing path too long exception when building this example project, close Visual Studio and rename the repository to short and build the project.