Xamarin.forms переупорядоченный raplayout ⇐ C#

Место общения программистов C#
Anonymous
Xamarin.forms переупорядоченный raplayout

Сообщение Anonymous »

У меня есть группа ячеек (из типа Stacklayout), и все они находятся в обертке. Кажется, я не могу понять, как сделать его переупорядоченным, похожим на перетаскивание ListView.WrapLayout layout = new WrapLayout
{
Spacing = 5,
Orientation = StackOrientation.Horizontal,
Padding = new Thickness(5, Device.OnPlatform(20, 5, 5), 5, 5),
HorizontalOptions = LayoutOptions.FillAndExpand,
VerticalOptions = LayoutOptions.FillAndExpand,
};
< /code>
И вот одна ячейка: < /p>
// Configure cell
var cell = new StackLayout
{
WidthRequest = Device.Idiom == TargetIdiom.Phone ? 60 : 140,
HeightRequest = Device.Idiom == TargetIdiom.Phone ? 60 : 50,
BackgroundColor = Color.FromRgb(60, 56, 72),
Children = {
new Label {
Text = Device.Idiom == TargetIdiom.Phone ? book.Contains("1") || book.Contains("2") || book.Contains("3") ? book.Substring(0,4).Replace(" ", "") : book.Substring(0,2) : book,
FontSize = 18,
TextColor = Color.White,
LineBreakMode = LineBreakMode.TailTruncation,
VerticalOptions = LayoutOptions.FillAndExpand,
HorizontalOptions = LayoutOptions.FillAndExpand,
VerticalTextAlignment = TextAlignment.Center,
HorizontalTextAlignment = TextAlignment.Center
}
}
};
layout.Children.Add(cell);
< /code>
А вот как приложение на самом деле выглядит на данный момент:
[! [The App] [3]] [3] < /p>
Любая помощь в этом может быть оценена. < /p.>

Подробнее здесь: https://stackoverflow.com/questions/420 ... wraplayout

Вернуться в «C#»