Xamarin ScrollView: HorizontalScrollBarVisibility is ignored on Android - xamarin.forms

I have a ScrollView which I want to always show the horizontal scroll bar. e.
I set
HorizontalScrollBarVisibility = ScrollBarVisibility.Always
but that does not seem to make any difference. I have also tried setting the ScrollBarFadingEnabled = false, setting the ScrollBarFadeDuration = 1000000000 and setting ScrollBarDefaultDelayBeforeFade = 1000000000but none of these properties seem to make any difference.
I have been able to achieve similar behavior in the past for VERTICAL scroll bars, and have even used and effect to change the size and color of the VERTICAL scroll bar. Is there some issue with the HORIZONTAL scroll bars for ScrollView in Xamarin Forms?

Try change styles.xml file in your Android project to keep them on and visible, like this:
<item name="android:fadeScrollbars">false</item>
<item name="android:scrollbarAlwaysDrawHorizontalTrack">true</item>
<item name="android:scrollbarSize">18dp</item>

Related

Ionic-Angular can't get list to scroll properly

I've been trying to programmatically scroll a list (accordion) in an Ionic-Angular app and I’ve been having no success at all.
I reproduced it in this stackblitz: https://stackblitz.com/edit/stack-overflow-ionic-scroll-problem?file=src/app/home/home.page.ts
When you click on an item, it expands and I want it to align to the top of the screen (with the title visible). In this example, I am using scrollIntoView() to get it to the top but it disappears behind the toolbar.
I've tried many things to get it to align properly (including setting a "scroll-margin-top" as suggested on many posts) but this hasn't worked for me.
Also, I can't seem to be able to use the scrollBy() or scrollTo() method... they do nothing at all.
Can anybody help me figure this out and get this precise example to work? Thanks in advance!
The problem is in the property [fullscreen]="true" of the <ion-content> tag.
The property fullscreen of ion-content, according to the ionic documentation...
If true, the content will scroll behind the headers and footers. This effect can easily be seen by setting the toolbar to transparent.
In ionic when you use the option fullscreen as in <ion-content [fullscreen]="true"> it adds the following style to the ion-content tag:
--offset-top: 56px;
The goal of the [fullscreen]="true" is to create the effect of the content scrolling behind the header.
As a side effect, part of the <ion-content> is hidden behind the <ion-header>.
Fullscreen property and scrollIntoView()
According to w3schools...
The scrollIntoView() method scrolls the specified element into the visible area of the browser window.
So, in your code, when you call scrollIntoView() of a group it is working exactly as expected. The screen is scrolled until the top o the group is into the visible area of the browser. The problem is that the <ion-header> is covering part of the top of this visible area.
Solution:
If you remove the [fullscreen]="true" of the <ion-content>tag the scroll will work as you expect.
But you will loose the effect created by the fullscreen property (content scrolling behing the header).
References
Fullscreen property of ion-content tag:
https://ionicframework.com/docs/api/content
ScrollIntoView:
https://www.w3schools.com/JSREF/met_element_scrollintoview.asp

How to disable auto scroll in the horizontal scroll bar

I have a tree view where i want to enable auto scroll for vertical scroll bar but want that feature to be disabled for horizontal scroll bar.
i could only find autoscroll option for this but it enables and disables both the scroll bars simultaneously.
Tree view is derived from QAbstractItemModel.
You can access them separately like this:
my_treeview->horizontalScrollbar()
You can change de policy of both scrollbars, in this case
my_treeview->setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff);

xamarin forms rounded edge progress bar and gradient color

Can anyone help with some tips to create a Progress Bar similare to the progress bar in the picture in both android and IOS.
Any tip or trick could be helpful.
ProgressBar picture
I know that on android applications in Xamarin Forms, the color of a progress bar is tied to the value of colorAccent in the styles file in the Android Resources folder.
To make the progress bar white you could make the colorAccent line like this:
<item name="colorAccent">#FFFFFF</item>
A warning with doing this, it will also change the colors of other views accent colors such as Switches.
To add the number next to the progress bar, it is easiest to do that with a label that is positioned next to the progress bar. Then in your code, whenever you change the value of the progress bar, you can also change the Text of the label.

How to show several QTableViews(without scrollbar) in QListWidget(or other similar widgets)?

I have a problem with showing multiple tables(without their own scrollbars) under one scrollbar. Is there any workaround or a good way to resolve this issue in Qt?
I've tried to do what you ask, and found this. So, here is a solution:
add QScrollArea to a form
set the property widgetResizable to true
put QWidget to scroll area
right click on widget -> Set ancestor -> [your scroll area]
add vertical layout to a widget
scroll area will collapse, epand it with a mouse
insert into the widget as many tables as you want
set vertical size policy for each table to Minimum and set minimal vertical size.
Here is how it looks:

scroll bar selectable

I have a canvas with a scrollbar and I would like to disable the scrollbar in some way that keeps the thumb visible, but not selectable. I just want to let the user know that there is more information below, but I do not want to let him use the scroll to move down(this will be done with the movement of the arrows). I tried using the properties enabled but it does not work.
Any ideas???
Thanks.
Canvas has verticalScrollBarStyleName used for scrollbar skinning. This is name of CSS style which will be assigned to vertical Scrollbar, which in turn has following styles:
thumbUpSkin, thumbOverSkin, thumbDownSkin. You need some custom class for thumb with mouseEnabled=false. Set these styles to this thumb class name.

Resources