Changing layout at runtime

I tried to use AddCards, but all items are displayed simultaneously at start:
installer2

When switching cards issue is fixed:
installer3

layout building code:

BLayoutBuilder::Group<>(fIntroContainerView, B_VERTICAL, B_USE_DEFAULT_SPACING)
	.SetInsets(B_USE_DEFAULT_SPACING)
	.Add(fIntroTitleView, 0)
	.Add(fIntroContentView, 0)
	.AddGlue()
	.End();

BLayoutBuilder::Group<>(fHeaderContainerView, B_HORIZONTAL, 0)
	.Add(fHeaderView)
	.AddGroup(B_VERTICAL, 0)
		.Add(fTitleView, 0)
		.Add(fSubtitleView, 0)
		.AddGlue()
		.End()
	.End();

BLayoutBuilder::Group<>(this, B_VERTICAL, 0)
	.AddCards()
		.GetLayout(&fCardLayout)
		.AddGroup(B_VERTICAL, 0)
			.AddGroup(B_HORIZONTAL, 0)
				.Add(fWizardView, 0)
				.Add(fIntroContainerView)
				.End()
			.End()
		.AddGroup(B_VERTICAL, 0)
			.Add(fHeaderContainerView)
			.Add(new BSeparatorView(B_HORIZONTAL))
			.AddGroup(B_VERTICAL, B_USE_DEFAULT_SPACING)
				.SetInsets(B_USE_DEFAULT_SPACING)
				.Add(fLicenseCaption1View, 0)
				.Add(new BScrollView("scrollview", fLicenseView, 0, true, true, B_PLAIN_BORDER))
				.Add(fLicenseCaption2View, 0)
				.End()
			.End()
		.End()
	.Add(new BSeparatorView(B_HORIZONTAL))
	.AddGroup(B_HORIZONTAL, B_USE_DEFAULT_SPACING)
		.SetInsets(B_USE_DEFAULT_SPACING)
		.AddGlue()
		.Add(fBackView)
		.Add(fNextView)
		.Add(fCancelView)
		.End()
	.End();

Is it a bug or I am doing something wrong?

1 Like