Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Doesnt scroll in scrollviewer #4

Closed
IeuanWalker opened this issue Mar 5, 2018 · 7 comments
Closed

Doesnt scroll in scrollviewer #4

IeuanWalker opened this issue Mar 5, 2018 · 7 comments

Comments

@IeuanWalker
Copy link

I've got quite a long .md file to display to the user.

I have tried putting this control inside a scrollviewer but it doesn't let me scroll down.
Here is my XAML -

<ScrollView HorizontalOptions="FillAndExpand" VerticalOptions="FillAndExpand">
    <mdview:MarkdownTextView BackgroundColor="Transparent"
                                Markdown="{Binding TestLbl}"
                                TextColor="White" />
</ScrollView>
@SuavePirate
Copy link
Owner

Have you tried putting it in another container layout within the scrollview?

@IeuanWalker
Copy link
Author

@SuavePirate Ye, I wrapped it in a stack layout and it doesn't make a difference

@SuavePirate
Copy link
Owner

Is this happening on all platforms? It seems to be working alright for me when wrapped in a Grid within the ScrollView. The StackLayout may not properly expand so I would try with a Grid or AbsoluteLayout

<ScrollView ...>
    <Grid>
        <suave:MarkDownTextView .../>
    <Grid>
</ScrollView>

@IeuanWalker
Copy link
Author

@SuavePirate sorry it's been awhile, but I tried your above suggestion and it hasn't worked :/
Here is my page -

<?xml version="1.0" encoding="utf-8" ?>
<ContentPage x:Class="CardiffMobileApp.Pages.CouncilTax.ConfirmationPopupPage"
             xmlns="http://xamarin.com/schemas/2014/forms"
             xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
             xmlns:controls="clr-namespace:Messier16.Forms.Controls;assembly=Messier16.Forms.Controls"
             xmlns:mdview="clr-namespace:SPControls.Forms;assembly=SPControls.MarkdownTextView"
             xmlns:svg="clr-namespace:FFImageLoading.Svg.Forms;assembly=FFImageLoading.Svg.Forms"
             Title="Statement"
             Style="{DynamicResource PageStyle}">
    <StackLayout Padding="10,5"
                 HorizontalOptions="FillAndExpand"
                 IsClippedToBounds="True"
                 Spacing="3"
                 VerticalOptions="FillAndExpand">
        <!-- Statement -->
        <ScrollView Margin="10"
                    HorizontalOptions="FillAndExpand"
                    VerticalOptions="FillAndExpand">
            <Grid>
                <mdview:MarkdownTextView BackgroundColor="Transparent"
                                         HorizontalOptions="FillAndExpand"
                                         LineBreakMode="WordWrap"
                                         Markdown="{Binding Statement}"
                                         TextColor="White"
                                         VerticalOptions="FillAndExpand" />
            </Grid>
        </ScrollView>

        <!-- Checkbox -->
        <StackLayout Margin="10"
                     HorizontalOptions="CenterAndExpand"
                     Orientation="Horizontal">
            <RelativeLayout VerticalOptions="CenterAndExpand">
                <svg:SvgCachedImage FadeAnimationDuration="2000"
                                    FadeAnimationEnabled="True"
                                    HeightRequest="59"
                                    HorizontalOptions="Center"
                                    RelativeLayout.XConstraint="{ConstraintExpression Type=RelativeToParent, Property=X, Factor=0, Constant=-13}"
                                    RelativeLayout.YConstraint="{ConstraintExpression Type=RelativeToParent, Property=Y, Factor=0, Constant=-12}"
                                    Source="resource://CardiffMobileApp.Resources.SVG.circle.svg"
                                    WidthRequest="59" />
                <controls:Checkbox CheckboxBackgroundColor="White"
                                   Checked="{Binding IsAccepted}"
                                   WidthRequest="35" />
            </RelativeLayout>
            <Label Text="I confirm I have read and agree"
                   TextColor="White"
                   VerticalOptions="CenterAndExpand" />
        </StackLayout>
        <!-- Accept Btn -->
        <Button Command="{Binding NextCommand}"
                IsVisible="{Binding IsAccepted}"
                Style="{DynamicResource ButtonStyle}"
                Text="Next"
                VerticalOptions="End" />
    </StackLayout>
</ContentPage>

@SuavePirate
Copy link
Owner

I'll try to replicate with a similar layout. Out of curiosity, if you replace the MarkdownTextView with a Label and just set the text to the really long string, does it scroll properly? I want to make sure it's just an issue with this component and not a Xam.Forms layout issue.

@IeuanWalker
Copy link
Author

@SuavePirate Sorry for a long update, ye works fine with a label

@IeuanWalker
Copy link
Author

Closing as no I no longer use this package

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants