From c9d369325a38541a675bca62a22911ca1a738241 Mon Sep 17 00:00:00 2001 From: "FAREAST\\xishui" Date: Thu, 17 Jan 2019 14:01:00 +0800 Subject: [PATCH] [Android]Fix container layout issue (#2308) --- .../adaptivecards/renderer/readonly/ContainerRenderer.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/source/android/adaptivecards/src/main/java/io/adaptivecards/renderer/readonly/ContainerRenderer.java b/source/android/adaptivecards/src/main/java/io/adaptivecards/renderer/readonly/ContainerRenderer.java index 3cab6f84d8..ef5c3bcd77 100644 --- a/source/android/adaptivecards/src/main/java/io/adaptivecards/renderer/readonly/ContainerRenderer.java +++ b/source/android/adaptivecards/src/main/java/io/adaptivecards/renderer/readonly/ContainerRenderer.java @@ -65,9 +65,14 @@ else if ((container = Container.dynamic_cast(baseCardElement)) == null) ContainerStyle styleForThis = container.GetStyle().swigValue() == ContainerStyle.None.swigValue() ? containerStyle : container.GetStyle(); LinearLayout containerView = new LinearLayout(context); + containerView.setOrientation(LinearLayout.VERTICAL); if(container.GetHeight() == HeightType.Stretch) { - containerView.setLayoutParams(new LinearLayout.LayoutParams(ViewGroup.LayoutParams.WRAP_CONTENT, ViewGroup.LayoutParams.MATCH_PARENT, 1)); + containerView.setLayoutParams(new LinearLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT, 1)); + } + else + { + containerView.setLayoutParams(new LinearLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT)); } VerticalContentAlignment contentAlignment = container.GetVerticalContentAlignment();