-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Cannot Hide Scrollview Bar on Android when Horizontal #4142
Comments
It's not possible to use an effect for this... If you look at the ScrollViewRenderer for Android, you'll see that it's actually TWO scroll views - an external vertical ScrollView (this is the Control instance that you will get in the renderer/effect) and a subview (which is a HoriztonalScrollView instance) that you don't have access to. However, you don't need to worry about this, because there is a property on the Xamarin Forms ScrollView element call "HorizontalScrollBarVisibility" that you can set to "Never". |
Ah, petermajor beat me to it.. He's right about why your Effect doesn't work, and that you can just use the But if you really, really need to access the horizontal ScrollView from an Effect, it is possible (if a bit cumbersome):
|
@petermajor Hi Peter Thanks for the response, I was suspecting that this was something to do with the underthehood implementation, I would like to know why the I feel a bit dumb that I didn't see the solution that forms offers me but nevertheless I still see this as a bug because the API exists & won't work (without telling you why). I might submit a request to have the docs updated to reflect this! |
@hartez Thanks a ton! It's nice to know that I can access it that way, this begs the question... Should this method be updated to call what you just wrote & to perform the task? In my opinion having the method in Forms is a bad idea because it's essentially android specific code within a supposedly 'platform agnostic' project. Obviously I see this as a bug because I can quickly whip it up on iOS, and then it only half works on Android. But I guess a doc change would suffice! |
Description
The scroll bar of a horizontal scroll view cannot be removed on android using the following code:
I have tested this issue with the use of Custom Renderers & Platform Effects, and successfully recreated in a sample repository.
The scrollview code can be seen here (although i've had this issue in other projects that look different to this)
Steps to Reproduce
Expected Behavior
The scrollbar has no horizontal indicator
Actual Behavior
The scrollbar has a horizontal indicator
This issue is not encountered on iOS, it behaves as usual (but obviously its a different platform & implementation).
Basic Information
Screenshots
Reproduction Link
I have created a standalone project demonstrating this issue, with a readme to guide you in setting up the issue.
https://github.com/Axemasta/ScrollView-Bug-Example
The text was updated successfully, but these errors were encountered: