How to hide scrollbar in listview in xamarin forms

gdkgdk INMember ✭✭✭

Hi everyone, I want to hide listview scrollbar in my xamarin andorid and xamarin ios application's. I have searched many post's but only few post's are having the helpful that to not clear. Please suggest any idea of hide scrollbar in listview.

Answers

  • N_BauaN_Baua INMember ✭✭✭✭✭

    Hi @gdk ,

    I were you, I wouldn't do it that way.
    First thing first, ListView or any scroll-able container tend to auto-scroll (mostly vertically) as a default OS dependent behavior. It is not a good practice to restrict that.

    Okey, for some reason, you want some values to be displayed as in a List like manner yet not scrolling, I would suggest you to build a custom control (probably using a grid) and iterate the values over.
    OR if you want to play with simple approach, use a loop and create the grid/label controls hierarchy (in code-behind) using a loop and display values likewise.

    Hope this helps.

    -- N Baua

  • gdkgdk INMember ✭✭✭

    Hi Baua. Thanks for reply, It seem's some difficult to create that control. Is there any way to hide scrollbar in list view using custom render's.

  • N_BauaN_Baua INMember ✭✭✭✭✭

    Hmm,

    I guess you will have to have custom renderer for that,

    on Android as far as my understanding is clear, you can set it off by using setScrollContainer(false).
    on iOS you can check with the UITableView and I recall it having the scrolling property for Horizontal and Vertical which you can set as NO (else try scrollEnabled = NO).

    Not sure if this gives you the EXACT solution, but still give it a shot.

    -- N Baua

  • SubramanyamRajuSubramanyamRaju INMember ✭✭

    Update: Now from Xamarin.Forms version 3.5.0, we can use VerticalScrollBarVisibility, HorizontalScrollBarVisibility properties to handle ListView ScrollBarVisibility.

    You can also find full source code and document from http://bsubramanyamraju.blogspot.com/2019/03/hide-listview-scrollbar-in-xamarinforms.html

Sign In or Register to comment.