2016-05-09 79 views
3
<?xml version="1.0" encoding="UTF-8"?> 
<ContentPage xmlns="http://xamarin.com/schemas/2014/forms" 
     xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml" 
     x:Class="Dh.ListPage"> 
<ContentPage.Content> 
    <ScrollView> 
     <StackLayout Style="{StaticResource MainStackLayoutWhenLoggedInStyle}"> 
      <Frame Style="{StaticResource FrameStyle2}"> 
       <StackLayout> 
        <Label Text="Vragenlijsten" Style="{StaticResource TitelLabelStyle}" /> 
       </StackLayout> 
      </Frame> 
      <Frame Style="{StaticResource FrameStyle2}"> 
       <StackLayout> 
        <Label Text="DRINGENDE VRAGEN: vul deze vragen meteen in!" Style="{StaticResource StandardLabelStyle}"/> 
        <Frame Style="{StaticResource FrameStyle2}"> 
         <StackLayout Style="{StaticResource ListViewStackLayoutStyle}" > 
          <ListView ItemTapped="OnItemTapped" ItemsSource="{Binding Question_Lists}" Style="{StaticResource StandardListViewStyle}"> 
           <ListView.ItemTemplate> 
            <DataTemplate> 
             <ViewCell> 
              <ViewCell.View> 
               <Label Text="{Binding Title}" Style="{StaticResource StandardLabelStyle}" /> 
              </ViewCell.View> 
             </ViewCell> 
            </DataTemplate> 
           </ListView.ItemTemplate> 
          </ListView> 
         </StackLayout> 
        </Frame> 
       </StackLayout> 
      </Frame> 
     </StackLayout> 
    </ScrollView> 
</ContentPage.Content> 

Xamarin窗體ListView滾動型不滾動

當我的屏幕太小,那麼我的列表視圖並不想滾動。如果我的屏幕不是很小,那麼listview就會滾動。有人可以幫我嗎?

回答

4

從不在一個ScrollView中堆疊一個ListView,因爲兩者都至少在Android上實現滾動。

+0

我的屏幕太小時,如何讓屏幕滾動? –

+0

有不同的選項,例如,您可以在StackLayout中使用ScrollView,然後將上面/下面的內容設置爲ListView的頁眉/頁腳。 –

+0

XF沒有提供'ItemsControl'選項是很愚蠢的。 – Shimmy