Skip to content

This example demonstrates how to enable to scrollbar in SfChat to scroll messages up and down.

Notifications You must be signed in to change notification settings

SyncfusionExamples/how-to-enable-scrollbar-in-sfchat

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 

Repository files navigation

How to show Scrollbar in SFChat to scroll messages up or down?

About the sample

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;

        }
    }

Enable Scrollbar In SfChat

Requirements to run the demo

Troubleshooting

Path too long exception

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.

About

This example demonstrates how to enable to scrollbar in SfChat to scroll messages up and down.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 3

  •  
  •  
  •  

Languages