Lou*_*upi 5 c# xaml background-image xamarin xamarin.forms
我知道没有BackgroundImage
为 ListView 类调用属性- 只有BackgroundColor
属性,但这不是我要找的。有没有办法将背景图像添加到 ListView,这样当我滚动图像时,图像会保持原位,并且在滚动时图块只是“移动”在图像上。
将图像添加到ContentPage
也不起作用,因为 ListView 只是覆盖它。
你的帖子真的很好,你只是错过了源属性上的双引号
将您的ListView
设置BackgroundColor
为Transparent
:
<RelativeLayout>
<Image Source="background.png"
BackgroundColor="Transparent"
VerticalOptions="CenterAndExpand"
HorizontalOptions="CenterAndExpand"/>
<ListView x:Name="listView"
VerticalOptions="CenterAndExpand"
HorizontalOptions="CenterAndExpand"
BackgroundColor="Transparent"
ItemTapped="OnItemTapped"
ItemsSource="{Binding .}" />
</RelativeLayout>
Run Code Online (Sandbox Code Playgroud)
归档时间: |
|
查看次数: |
2450 次 |
最近记录: |