가로 목록보기에서 항목 (0-23)을 가로로 스크롤하려고합니다.가로 목록보기의 높이 줄이기 - 자마린 양식
목록보기가 가로 방향으로 표시되지만 목록보기의 높이가 내용에 줄 바꿈되지 않습니다. RelativeLayout을 xConstraint, yConstraint, width 및 heightConstraint와 함께 사용해 보았습니다. 매개 변수 값을 변경하려고 시도했지만 listview는 값을 변경하는 모든 시간이 사라졌습니다.
ListView lv = new ListView
{
SeparatorVisibility = SeparatorVisibility.None,
ItemsSource = items,
Rotation = 270,
ItemTemplate = new DataTemplate(() =>
{
Label label = new Label()
{
Rotation = 90,
TextColor = Color.Black,
HorizontalTextAlignment = TextAlignment.Center,
FontSize = Device.GetNamedSize(NamedSize.Small, new Label())
};
label.SetBinding<User>(Label.TextProperty, indexer => indexer.Time);
return new ViewCell
{
View = new StackLayout
{
Children =
{
label
}
}
};
})
};
RelativeLayout rLayout = new RelativeLayout();
rLayout.Children.Add(lv,
xConstraint: Constraint.RelativeToParent((parent) =>
{
return (parent.Width/0.5) - 30;
}),
yConstraint: Constraint.RelativeToParent((parent) =>
{
return (parent.Height/-0.5) + 3;
}),
widthConstraint: Constraint.Constant(60),
heightConstraint: Constraint.RelativeToParent((Parent) =>
{
return (Parent.Height/10);
})
);
Content = new StackLayout
{
Children = {
rLayout
}
};
저는 xamarin을 처음 사용하고 있습니다. 제가 잘못 가고있는 방식 일 수 있습니다. 그렇다면 나에게 맞는 것을 제안 해주세요.하지만 전체적으로 나는 항목으로만 숫자를 갖는 가로 목록보기를 원합니다. 그리고 높이를 내용으로 감싸고 싶습니다.
어떤 도움이 사전에 .. 감사 감지 할 수있을 것이다 ..
같은 간단한 시나리오 아마 사용하는 것이''' 내부'. 'ItemsSource' 속성을 가진'StackLayout'에 기반한 커스텀 컨트롤을 만듭니다. –
아마도 [회전식보기] (https://blog.xamarin.com/flipthrough-items-with-xamarin-forms-carouselview/)를 사용해 볼 수 있습니다. 비록 당신의 유스 케이스에 맞을 지 확실하지 않다. –
당신 대답에 감사합니다 @ EgorGromadskiy 그것은 나를 도울 .. 늦게 답장을 보내 주셔서 죄송합니다 .. – user5598997