私はそれが簡単に適用することが分かったが、それは似たような(と私より良い方法はおそらくあります)でなければなりませんように私は、コードではなく、XAMLでこれをやりました。
FlowListViewコントロールで 'HasUnevenRows'プロパティをtrueに設定しました。私の行はそれに3枚の画像を持っていたとして、私は「Application.Current.MainPage.Width/3」であると「HeightRequest」プロパティを設定する画像上のその後
Flow = new FlowListView()
{
VerticalOptions = LayoutOptions.FillAndExpand,
HorizontalOptions = LayoutOptions.FillAndExpand,
FlowColumnCount = 3,
FlowColumnTemplate = new DataTemplate(typeof(FlowCellImage)),
FlowTappedBackgroundDelay = 250,
FlowTappedBackgroundColor = Color.Gray,
SeparatorVisibility = SeparatorVisibility.Default,
IsPullToRefreshEnabled = true,
HasUnevenRows = true,
//Margin = thickness
};
。
public class FlowCellImage : FlowViewCell
{
private Image ImgPost;
public FlowCellImage()
{
ImgPost = new Image
{
Aspect = Aspect.AspectFill
};
ImgPost.SetBinding(Image.SourceProperty, "ThumbnailUrl");
HeightRequest = Application.Current.MainPage.Width/3;
Content = ImgPost;
}
}
私は同じ問題に直面しています。これを解決しましたか? – AbsoluteSith