2017-08-10 17 views
0

私のコンテンツには、 'StackLayout'が固定されていて、4 'ボタンが含まれる場所に浮かれています。フローティングStackLayout xamarinフォーム

マイレイアウトGridは次のように、同一の行と列の項目を配置することによって、他のものの上にものを浮遊することができる瞬間

 <?xml version="1.0" encoding="utf-8" ?> 
     <ContentPage xmlns="http://xamarin.com/schemas/2014/forms" 
     xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml" 
     Title="teste"> 


    <Grid> 
     <ScrollView BackgroundColor="#ffffff" Padding="15" Grid.Row="0"> 
     <StackLayout HorizontalOptions="Fill" VerticalOptions="FillAndExpand"> 
      <Label Text="{Binding Titulo}" VerticalTextAlignment="Center" HorizontalTextAlignment="Center" TextColor="#38B6AB" FontSize="22" FontAttributes="Bold"/> 
      <Label Text="{Binding Data}" VerticalTextAlignment="Center" HorizontalTextAlignment="Center" TextColor="#5a5a5a" FontSize="18" FontAttributes="Bold"/> 

      <Image x:Name="imagen1" Source="{Binding ImageSource}" Aspect="AspectFit"> 
       <Image.GestureRecognizers> 
        <TapGestureRecognizer 
        Tapped="OnTapped" /> 
       </Image.GestureRecognizers> 
      </Image> 

     </StackLayout> 
    </ScrollView> 
</Grid> 
//-----Floating button----- // 

答えて

1

assikmあります。 Buttonの配置方法によっては、ユーザがスクロールしていると思われる場所にButtonを置くことはユーザビリティの問題になることに注意してください。

<Grid> 

    <Grid.RowDefinitions> 
    <RowDefinition Height="Auto" /> 
    </Grid.RowDefinitions> 

    <Grid.ColumnDefinitions> <!-- Multiple columns will allow even Button spacing, just set Grid.ColumnSpan on your ScrollView --> 
    <ColumnDefinition Width="*" /> 
    <ColumnDefinition Width="*" /> 
    <ColumnDefinition Width="*" /> 
    <ColumnDefinition Width="*" /> 
    </Grid.ColumnDefinitions> 

    <ScrollView BackgroundColor="#ffffff" 
       Padding="15" 
       Grid.Row="0" 
       Grid.Column="0" 
       Grid.ColumnSpan="4"> 
    <StackLayout HorizontalOptions="Fill" 
       VerticalOptions="FillAndExpand"> 
      ....     
    </StackLayout> 
    </ScrollView> 

    <Button Text="One" 
      Grid.Row="0" 
      Grid.Column="0"/> 

    <Button Text="Two" 
      Grid.Row="0" 
      Grid.Column="1"/> 

    <Button Text="Three" 
      Grid.Row="0" 
      Grid.Column="2"/> 

    <Button Text="Four" 
      Grid.Row="0" 
      Grid.Column="3"/> 
</Grid> 
+0

2のエラーは、ボタンがscrowviewを移動する方法、他のエラーが存在しない、すべてのコンテンツを取るとボタンが –

+0

ホセ@あなたが場所を指定していない、中央に正確であるとフッタに表示されますあなたは 'ボタン'を望んでいた。これは、それを行う方法を示す出発点に過ぎません。あなたが欲しいと望むまで、それを微調整してください。それは解決策に欠けるものではありませんが、それを行う方法を学ぶのを助けるためのものです。あなたが好きな方法でそれらを配置するのに問題がある場合は、私に知らせるか、新しい質問を投稿してください、 – hvaughan3

+1

いいえ、私は位置を特定するのが難しいです、私は別の質問を開きます –

関連する問題