【发布时间】:2020-01-12 21:44:29
【问题描述】:
我需要在我的项目中集成动态水平列表视图。我在网站上的博客下面发现了这个概念。但是我混淆了这段代码以集成到我的项目中。请向任何人建议我的想法。我需要这种图像类型的网格或水平列表视图(https://i.stack.imgur.com/OvJZE.png)。
Mainpage.xaml.cs
public void SetupUserStack()
{
---------- issue in _itemSelectCommand in my code
cButtonList.Add(new CircleButton(_itemSelectCommand)
{ CircleSize = otherCircleSize, CircleFontSize = 35, Text = initials, BackgroundColor = Color.White, TextColor = ourBlue, BorderColor = ourBlue, BorderWidth = 1.5 });
var b2 = new Button() { Text = lname, TextColor = ourBlue };
//otherGrid.Children.Add(LargeCB, 0, 0);
otherGrid.Children.Add(cButtonList[i], 0, 0);
otherGrid.Children.Add(b2, 0, 1);
UserStack.Children.Add(otherGrid);
}
我参考的博客:horizontal-list-view-with-circular-button-styling-in-xamarin-forms
【问题讨论】:
-
你真正想要什么?水平列表视图?有什么要求吗?
-
我附上了下面的博客网站以供参考水平列表视图你可以检查吗?
-
我不知道如何将博客网站代码以 MVVM 结构集成到我的项目中
-
使用 collectionView 代替,然后将 itemSource 绑定到 ViewModel 中的属性。
-
你能给我一个想法,将下面的参考资料整合到我的项目中。
标签: xamarin.forms cross-platform