Scrollview not working

xmkxmk USMember

Hi I have structure like below.





Problem - View is not scrolling. Are we not allowed such a nesting of structure with scrollview.

Tagged:

Best Answers

Answers

  • xmkxmk USMember

    For some reason the structure we stripped off...

    Stacklayout
    scrollview
    stacklayout
    relativelayout
    labels
    images
    controls
    stacklayout
    frame
    stacklayout

  • AdrianKnightAdrianKnight USMember ✭✭✭✭

    Wrap your code with the code tag. It's the 'C' in the forum text editor.

  • FredyWengerFredyWenger CHInsider ✭✭✭✭✭

    You really should post your real code (so that we can see, which element is enclosed by another (or add start- and end-tags to your list like:

    • start Stacklayout1
    • start Scrollview1
    • end Scrollview1
    • end Stacklayout1
    • start xxx
      Else... we can't help you...
  • xmkxmk USMember

    Sure let me put that for some reason the indentation was removed...

    <Stacklayout> <scrollview> <stacklayout> <relativelayout> <labels/> <image/> <control/> <stacklayout> </stacklayout> <frame> </frame> </stacklayout> </scrollview> </Stacklayout>

  • AdrianKnightAdrianKnight USMember ✭✭✭✭

    Copy the code directly from your XAML. The above code has missing tags.

  • xmkxmk USMember

    `




      <RelativeLayout Padding="0" VerticalOptions="FillAndExpand" HorizontalOptions="FillAndExpand">
        <!--Top Bar-->
        <Image Source="Icon.png"
               RelativeLayout.XConstraint="{ConstraintExpression Type=RelativeToParent,Property=X,Constant=314 }"
               RelativeLayout.YConstraint="{ConstraintExpression Type=RelativeToParent,Property=Y,Constant=29 }"
               WidthRequest="53"
               HeightRequest="24"></Image>
        <Label Text="&lt;" Style="{StaticResource NavigationStyle}"
               RelativeLayout.XConstraint="{ConstraintExpression Type=RelativeToParent,Property=X,Constant=8.5 }"
               RelativeLayout.YConstraint="{ConstraintExpression Type=RelativeToParent,Property=Y,Constant=31.5 }">
          <Label.GestureRecognizers>
            <TapGestureRecognizer Command="{Binding go}"></TapGestureRecognizer>
          </Label.GestureRecognizers>
        </Label>
        <Label Text="test" Style="{StaticResource NavigationStyle}"
               RelativeLayout.XConstraint="{ConstraintExpression Type=RelativeToParent,Property=X,Constant=27 }"
               RelativeLayout.YConstraint="{ConstraintExpression Type=RelativeToParent,Property=Y,Constant=31.5 }">
          <Label.GestureRecognizers>
            <TapGestureRecognizer Command="{Binding go}"></TapGestureRecognizer>
          </Label.GestureRecognizers>
        </Label>
        <!--End of Top Bar-->
        <!--Hexagon Images-->
      <Image Source="callButton.png"
               RelativeLayout.XConstraint="{ConstraintExpression Type=RelativeToParent,Property=X,Constant=190 }"
               RelativeLayout.YConstraint="{ConstraintExpression Type=RelativeToParent,Property=Y,Constant=83 }"
               WidthRequest="50"
               HeightRequest="58">
        <Image.GestureRecognizers>
        <TapGestureRecognizer Command="{Binding Call}"></TapGestureRecognizer>
        </Image.GestureRecognizers>
      </Image>
      <Image Source="emailButton.png"
               RelativeLayout.XConstraint="{ConstraintExpression Type=RelativeToParent,Property=X,Constant=250 }"
               RelativeLayout.YConstraint="{ConstraintExpression Type=RelativeToParent,Property=Y,Constant=83 }"
               WidthRequest="50"
               HeightRequest="58">
        <Image.GestureRecognizers>
          <TapGestureRecognizer Command="{Binding Email}"></TapGestureRecognizer>
        </Image.GestureRecognizers>
      </Image>
      <Image Source="vButton.png"
               RelativeLayout.XConstraint="{ConstraintExpression Type=RelativeToParent,Property=X,Constant=310 }"
               RelativeLayout.YConstraint="{ConstraintExpression Type=RelativeToParent,Property=Y,Constant=83 }"
               WidthRequest="50"
               HeightRequest="58">
        <Image.GestureRecognizers>
          <TapGestureRecognizer Command="{Binding contact}"></TapGestureRecognizer>
        </Image.GestureRecognizers>
      </Image>
        <!--End of Hexagon Images-->
        <!--Basic profile information-->
      <controls:HexagonalImage Source="{Binding picurl}" x:Name="pic"
               RelativeLayout.XConstraint="{ConstraintExpression Type=RelativeToParent,Property=X,Constant=18 }"
               RelativeLayout.YConstraint="{ConstraintExpression Type=RelativeToParent,Property=Y,Constant=68 }"
               WidthRequest="78"
               HeightRequest="88"></controls:HexagonalImage>
      <Label Text="{Binding Name}" Style="{StaticResource name}"
             RelativeLayout.XConstraint="{ConstraintExpression Type=RelativeToParent,Property=X,Constant=15 }"
             RelativeLayout.YConstraint="{ConstraintExpression Type=RelativeToView,ElementName=pic, Property=Y,Constant=105 }"></Label>
      <Label Text="{Binding Title}" Style="{StaticResource title}"
             RelativeLayout.XConstraint="{ConstraintExpression Type=RelativeToParent,Property=X,Constant=15 }"
             RelativeLayout.YConstraint="{ConstraintExpression Type=RelativeToView,ElementName=pic, Property=Y,Constant=127 }"></Label>
      <Image Source="location.png"
               RelativeLayout.XConstraint="{ConstraintExpression Type=RelativeToParent,Property=X,Constant=16 }"
               RelativeLayout.YConstraint="{ConstraintExpression Type=RelativeToView,ElementName=pic, Property=Y,Constant=147 }"
               WidthRequest="8"
               HeightRequest="11.4"></Image>
      <Label Text="{Binding City}" Style="{StaticResource city}"
             RelativeLayout.XConstraint="{ConstraintExpression Type=RelativeToParent,Property=X,Constant=27.5 }"
             RelativeLayout.YConstraint="{ConstraintExpression Type=RelativeToView,ElementName=pic, Property=Y,Constant=147 }"></Label>
        <!--End of Basic profile information-->
        <!--Section Headers and sections-->
    
    
        <StackLayout Orientation="Vertical" VerticalOptions="End" Margin="0,0,0,44"  RelativeLayout.YConstraint="{ConstraintExpression Type=RelativeToView,ElementName=pic, Property=Y,Constant=182 }">
    
          <Label Text="About" Style="{StaticResource HeaderTop}" >
            <Label.GestureRecognizers>
              <TapGestureRecognizer Command="{Binding Toggle}"></TapGestureRecognizer>
            </Label.GestureRecognizers>
          </Label>
          <Label  FormattedText="{Binding AboutMe}" x:Name="About" Style="{StaticResource SectionContent}">
            <Label.GestureRecognizers>
              <TapGestureRecognizer Command="{Binding Email}" ></TapGestureRecognizer>
            </Label.GestureRecognizers>
          </Label>
          <Label Text="Industry Experience" Style="{StaticResource SectionHeaderOther}"></Label>
          <Label FormattedText="{Binding IndustryExperience}" Style="{StaticResource SectionContent}"></Label>
          <Label Text="Ask Me" Style="{StaticResource SectionHeaderOther}"></Label>
          <Label FormattedText="{Binding AskMe}" Style="{StaticResource SectionContent}"></Label>
        </StackLayout>
    
        <!--End of Section Headers and sections-->
        <!--Social Buttons-->
        <Frame Padding="0" HasShadow="False" 
               RelativeLayout.XConstraint="{ConstraintExpression Type=RelativeToParent,Property=X,Constant=0 }"
          RelativeLayout.YConstraint="{ConstraintExpression Type=RelativeToView,ElementName=pic, Property=Y,Constant=556 }">
        <StackLayout Orientation="Horizontal" Style="{StaticResource SocialBar}">
          <Image Margin="65,0,0,0"  WidthRequest="10" HeightRequest="20" Source="facebookIcon.png"></Image>
          <Image WidthRequest="19" HeightRequest="16" Source="twitterIcon.png"></Image>
          <Image WidthRequest="16" HeightRequest="16" Source="linkedinIcon.png"></Image>
          <Image WidthRequest="26" HeightRequest="18" Source="ChartIcon.png"></Image>
        </StackLayout>
        </Frame>
        <!--End of social buttons-->
      </RelativeLayout>
    
    </StackLayout>
    

    `

  • xmkxmk USMember

    again c tag removed starting and ending tags so if you see my last two responses you will have the complete structure...

  • xmkxmk USMember
    <StackLayout x:Name="Container" Style="{StaticResource ContainerStyle}" BindingContext="{Binding UserData}">
       <ScrollView IsClippedToBounds="True" Orientation="Vertical" VerticalOptions="FillAndExpand">
        <StackLayout x:Name="TopBar" Style="{StaticResource TopBarStyle}" HeightRequest="112">
    <RelativeLayout Padding="0" VerticalOptions="FillAndExpand" HorizontalOptions="FillAndExpand">
        <!--Top Bar-->
        <Image Source="Icon.png"
               RelativeLayout.XConstraint="{ConstraintExpression Type=RelativeToParent,Property=X,Constant=314 }"
               RelativeLayout.YConstraint="{ConstraintExpression Type=RelativeToParent,Property=Y,Constant=29 }"
               WidthRequest="53"
               HeightRequest="24"></Image>
        <Label Text="&lt;" Style="{StaticResource NavigationStyle}"
               RelativeLayout.XConstraint="{ConstraintExpression Type=RelativeToParent,Property=X,Constant=8.5 }"
               RelativeLayout.YConstraint="{ConstraintExpression Type=RelativeToParent,Property=Y,Constant=31.5 }">
          <Label.GestureRecognizers>
            <TapGestureRecognizer Command="{Binding go}"></TapGestureRecognizer>
          </Label.GestureRecognizers>
        </Label>
        <Label Text="test" Style="{StaticResource NavigationStyle}"
               RelativeLayout.XConstraint="{ConstraintExpression Type=RelativeToParent,Property=X,Constant=27 }"
               RelativeLayout.YConstraint="{ConstraintExpression Type=RelativeToParent,Property=Y,Constant=31.5 }">
          <Label.GestureRecognizers>
            <TapGestureRecognizer Command="{Binding go}"></TapGestureRecognizer>
          </Label.GestureRecognizers>
        </Label>
        <!--End of Top Bar-->
        <!--Hexagon Images-->
      <Image Source="callButton.png"
               RelativeLayout.XConstraint="{ConstraintExpression Type=RelativeToParent,Property=X,Constant=190 }"
               RelativeLayout.YConstraint="{ConstraintExpression Type=RelativeToParent,Property=Y,Constant=83 }"
               WidthRequest="50"
               HeightRequest="58">
        <Image.GestureRecognizers>
        <TapGestureRecognizer Command="{Binding Call}"></TapGestureRecognizer>
        </Image.GestureRecognizers>
      </Image>
      <Image Source="emailButton.png"
               RelativeLayout.XConstraint="{ConstraintExpression Type=RelativeToParent,Property=X,Constant=250 }"
               RelativeLayout.YConstraint="{ConstraintExpression Type=RelativeToParent,Property=Y,Constant=83 }"
               WidthRequest="50"
               HeightRequest="58">
        <Image.GestureRecognizers>
          <TapGestureRecognizer Command="{Binding Email}"></TapGestureRecognizer>
        </Image.GestureRecognizers>
      </Image>
      <Image Source="vButton.png"
               RelativeLayout.XConstraint="{ConstraintExpression Type=RelativeToParent,Property=X,Constant=310 }"
               RelativeLayout.YConstraint="{ConstraintExpression Type=RelativeToParent,Property=Y,Constant=83 }"
               WidthRequest="50"
               HeightRequest="58">
        <Image.GestureRecognizers>
          <TapGestureRecognizer Command="{Binding contact}"></TapGestureRecognizer>
        </Image.GestureRecognizers>
      </Image>
        <!--End of Hexagon Images-->
        <!--Basic profile information-->
      <controls:HexagonalImage Source="{Binding picurl}" x:Name="pic"
               RelativeLayout.XConstraint="{ConstraintExpression Type=RelativeToParent,Property=X,Constant=18 }"
               RelativeLayout.YConstraint="{ConstraintExpression Type=RelativeToParent,Property=Y,Constant=68 }"
               WidthRequest="78"
               HeightRequest="88"></controls:HexagonalImage>
      <Label Text="{Binding Name}" Style="{StaticResource name}"
             RelativeLayout.XConstraint="{ConstraintExpression Type=RelativeToParent,Property=X,Constant=15 }"
             RelativeLayout.YConstraint="{ConstraintExpression Type=RelativeToView,ElementName=pic, Property=Y,Constant=105 }"></Label>
      <Label Text="{Binding Title}" Style="{StaticResource title}"
             RelativeLayout.XConstraint="{ConstraintExpression Type=RelativeToParent,Property=X,Constant=15 }"
             RelativeLayout.YConstraint="{ConstraintExpression Type=RelativeToView,ElementName=pic, Property=Y,Constant=127 }"></Label>
      <Image Source="location.png"
               RelativeLayout.XConstraint="{ConstraintExpression Type=RelativeToParent,Property=X,Constant=16 }"
               RelativeLayout.YConstraint="{ConstraintExpression Type=RelativeToView,ElementName=pic, Property=Y,Constant=147 }"
               WidthRequest="8"
               HeightRequest="11.4"></Image>
      <Label Text="{Binding City}" Style="{StaticResource city}"
             RelativeLayout.XConstraint="{ConstraintExpression Type=RelativeToParent,Property=X,Constant=27.5 }"
             RelativeLayout.YConstraint="{ConstraintExpression Type=RelativeToView,ElementName=pic, Property=Y,Constant=147 }"></Label>
        <!--End of Basic profile information-->
        <!--Section Headers and sections-->
    
    
        <StackLayout Orientation="Vertical" VerticalOptions="End" Margin="0,0,0,44"  RelativeLayout.YConstraint="{ConstraintExpression Type=RelativeToView,ElementName=pic, Property=Y,Constant=182 }">
    
          <Label Text="About" Style="{StaticResource HeaderTop}" >
            <Label.GestureRecognizers>
              <TapGestureRecognizer Command="{Binding Toggle}"></TapGestureRecognizer>
            </Label.GestureRecognizers>
          </Label>
          <Label  FormattedText="{Binding AboutMe}" x:Name="About" Style="{StaticResource SectionContent}">
            <Label.GestureRecognizers>
              <TapGestureRecognizer Command="{Binding Email}" ></TapGestureRecognizer>
            </Label.GestureRecognizers>
          </Label>
          <Label Text="Industry Experience" Style="{StaticResource SectionHeaderOther}"></Label>
          <Label FormattedText="{Binding IndustryExperience}" Style="{StaticResource SectionContent}"></Label>
          <Label Text="Ask Me" Style="{StaticResource SectionHeaderOther}"></Label>
          <Label FormattedText="{Binding AskMe}" Style="{StaticResource SectionContent}"></Label>
        </StackLayout>
    
        <!--End of Section Headers and sections-->
        <!--Social Buttons-->
        <Frame Padding="0" HasShadow="False" 
               RelativeLayout.XConstraint="{ConstraintExpression Type=RelativeToParent,Property=X,Constant=0 }"
          RelativeLayout.YConstraint="{ConstraintExpression Type=RelativeToView,ElementName=pic, Property=Y,Constant=556 }">
        <StackLayout Orientation="Horizontal" Style="{StaticResource SocialBar}">
          <Image Margin="65,0,0,0"  WidthRequest="10" HeightRequest="20" Source="facebookIcon.png"></Image>
          <Image WidthRequest="19" HeightRequest="16" Source="twitterIcon.png"></Image>
          <Image WidthRequest="16" HeightRequest="16" Source="linkedinIcon.png"></Image>
          <Image WidthRequest="26" HeightRequest="18" Source="ChartIcon.png"></Image>
        </StackLayout>
        </Frame>
        <!--End of social buttons-->
      </RelativeLayout>
    
    </StackLayout>
    </ScrollView>
      </StackLayout>
    
  • FredyWengerFredyWenger CHInsider ✭✭✭✭✭

    @xmk:
    I second, what @AdrianKnight has wrote. I further don't would mix stacklayout with relativelayout.
    So... I also would remove the relativelayout and reduce the complexity of the whole structure to the minium needed...

  • xmkxmk USMember

    Thanks !! was ale to figure this with following structure. Did not change much reduced one stack layout and moved Scroll View out of Relative Layout

    <stacklayout> <scrollview> <RelativeLayout> <BoxView> <image> <label> <image> <image> <Control> <label> <stacklayout> </stacklayout> </relativeLayout> </Scrollview> </stacklayout>

Sign In or Register to comment.