0
1つのスタックレイアウトに2つの水平スクロールビューを一緒に追加しようとしています。しかし最後のスクロールビュー(scrollView1
)のみが表示されます。なぜ最初にscrollView
が表示されないのですか?Xamarinフォームのstacklayoutに2つのスクロールビューを一緒に表示できません
var avatarLayout = new StackLayout()
{
HeightRequest = 500,
};
StackLayout st = new StackLayout()
{
Orientation = StackOrientation.Horizontal
};
st.Children.Add(postImage1);
st.Children.Add(postImage2);
st.Children.Add(postImage3);
StackLayout st1 = new StackLayout()
{
Orientation = StackOrientation.Horizontal
};
st1.Children.Add(postImage4);
st1.Children.Add(postImage5);
st1.Children.Add(postImage6);
ScrollView scrollView = new ScrollView()
{
HorizontalOptions = LayoutOptions.Fill,
Orientation = ScrollOrientation.Horizontal,
Content = new StackLayout{
Orientation = StackOrientation.Horizontal,
Children = {st}
}
};
ScrollView scrollView1 = new ScrollView()
{
HorizontalOptions = LayoutOptions.Fill,
Orientation = ScrollOrientation.Horizontal,
Content = new StackLayout
{
Orientation = StackOrientation.Horizontal,
Children = {st1}
}
};
avatarLayout.Children.Add(avatarImage);
avatarLayout.Children.Add(friends);
avatarLayout.Children.Add(scrollView);
avatarLayout.Children.Add(cars);
avatarLayout.Children.Add(scrollView1);
avatarLayout.Children.Add(posts1);
解決済み。
ありがとう、それは愚かなミスだった –