Xamarin.Forms di Android. Saya memiliki scrollView dengan tumpukan di dalamnya. Gulir berfungsi, tetapi scrollBar tidak terlihat. Saya sudah mencoba menulis render khusus tetapi tidak membantu. Kode saya: https://github.com/FeduniakVitalii/ScrollView

var contentAndWebViewLayout = new StackLayout() { Orientation = StackOrientation.Vertical, VerticalOptions = LayoutOptions.FillAndExpand};
            contentAndWebViewLayout.Children.Add(contentLayout);
            contentAndWebViewLayout.Children.Add(webView);

            ScrollView scrollView = new ScrollView()
            {
                Content = contentAndWebViewLayout,
                IsEnabled = true,
                IsVerticalScrollbarEnabled = true,
                IsClippedToBounds = true,
                VerticalScrollBarVisibility = ScrollBarVisibility.Always,
                VerticalOptions = LayoutOptions.FillAndExpand,
            };

            var converter = new HtmlLabelConverter();

            var layout = new RelativeLayout()
            {
                BackgroundColor = Color.White,
                VerticalOptions = LayoutOptions.FillAndExpand
            };

            layout.Children.Add(scrollView,
            xConstraint: Constraint.Constant(0),
                    yConstraint: Constraint.Constant(0),
                    widthConstraint: Constraint.RelativeToParent((parent) => { return parent.Width; }),
                    heightConstraint: Constraint.RelativeToParent((parent) => { return parent.Height; }));

            this.Content = layout;
2
Vitalii Feduniak 21 September 2019, 13:16

1 menjawab

Jawaban Terbaik

Saya mencoba menurunkan versi Xamarin.Forms ke 3.4, masalah terpecahkan!

2
Vitalii Feduniak 23 September 2019, 10:31