summaryrefslogtreecommitdiff
path: root/docs/Xamarin.Forms.Core/Xamarin.Forms/StackLayout.xml
blob: df187061f6d1772cb36a5351fe3e2ed45dd4bb8f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
<Type Name="StackLayout" FullName="Xamarin.Forms.StackLayout">
  <TypeSignature Language="C#" Value="public class StackLayout : Xamarin.Forms.Layout&lt;Xamarin.Forms.View&gt;" />
  <TypeSignature Language="ILAsm" Value=".class public auto ansi beforefieldinit StackLayout extends Xamarin.Forms.Layout`1&lt;class Xamarin.Forms.View&gt;" />
  <AssemblyInfo>
    <AssemblyName>Xamarin.Forms.Core</AssemblyName>
    <AssemblyVersion>1.0.0.0</AssemblyVersion>
    <AssemblyVersion>1.1.0.0</AssemblyVersion>
    <AssemblyVersion>1.2.0.0</AssemblyVersion>
    <AssemblyVersion>1.3.0.0</AssemblyVersion>
    <AssemblyVersion>1.3.3.0</AssemblyVersion>
    <AssemblyVersion>1.4.0.0</AssemblyVersion>
    <AssemblyVersion>1.5.0.0</AssemblyVersion>
    <AssemblyVersion>2.0.0.0</AssemblyVersion>
  </AssemblyInfo>
  <Base>
    <BaseTypeName>Xamarin.Forms.Layout&lt;Xamarin.Forms.View&gt;</BaseTypeName>
    <BaseTypeArguments>
      <BaseTypeArgument TypeParamName="T">Xamarin.Forms.View</BaseTypeArgument>
    </BaseTypeArguments>
  </Base>
  <Interfaces />
  <Docs>
    <summary>A <see cref="T:Xamarin.Forms.Layout`1" /> that positions child elements in a single line which can be oriented vertically or horizontally.</summary>
    <remarks>
      <para>Because <see cref="T:Xamarin.Forms.StackLayout" /> layouts override the bounds on their child elements, application developers should not set bounds on them.</para>
      <example>
        <para>The following example code, adapted from the <format type="text/html"><a href="http://developer.xamarin.com/samples/tag/Xamarin.Forms/" target="_blank">FormsGallery</a></format> example shows how to create a new <see cref="T:Xamarin.Forms.StackLayout" /> with children that explore many of the layout behaviors of <see cref="T:Xamarin.Forms.StackLayout" />:</para>
        <code lang="C#"><![CDATA[
StackLayout stackLayout = new StackLayout
{
    Spacing = 0,
    VerticalOptions = LayoutOptions.FillAndExpand,
    Children = 
    {
        new Label
        {
            Text = "StackLayout",
            HorizontalOptions = LayoutOptions.Start
        },
        new Label
        {
            Text = "stacks its children",
            HorizontalOptions = LayoutOptions.Center
        },
        new Label
        {
            Text = "vertically",
            HorizontalOptions = LayoutOptions.End
        },
        new Label
        {
            Text = "by default,",
            HorizontalOptions = LayoutOptions.Center
        },
        new Label
        {
            Text = "but horizontal placement",
            HorizontalOptions = LayoutOptions.Start
        },
        new Label
        {
            Text = "can be controlled with",
            HorizontalOptions = LayoutOptions.Center
        },
        new Label
        {
            Text = "the HorizontalOptions property.",
            HorizontalOptions = LayoutOptions.End
        },
        new Label
        {
            Text = "An Expand option allows one or more children " +
                   "to occupy the an area within the remaining " +
                   "space of the StackLayout after it's been sized " +
                   "to the height of its parent.",
            VerticalOptions = LayoutOptions.CenterAndExpand,
            HorizontalOptions = LayoutOptions.End
        },
        new StackLayout
        {
            Spacing = 0,
            Orientation = StackOrientation.Horizontal,
            Children = 
            {
                new Label
                {
                    Text = "Stacking",
                },
                new Label
                {
                    Text = "can also be",
                    HorizontalOptions = LayoutOptions.CenterAndExpand
                },
                new Label
                {
                    Text = "horizontal.",
                },
            }
        }
    }
};
]]></code>
      </example>
      <para>
        <img href="StackLayout.TripleScreenShot.png" />
      </para>
      <para>XAML for Xamarin.Forms supports the following properties for the <see cref="T:Xamarin.Forms.StackLayout" /> class:</para>
      <list type="table">
        <listheader>
          <term>Property</term>
          <description>Value</description>
        </listheader>
        <item>
          <term>Orientation</term>
          <description>
            <para>
              <c>Horizontal</c> or <c>Vertical</c>. The default is <c>Vertical</c>.</para>
          </description>
        </item>
        <item>
          <term>Spacing</term>
          <description>
            <para>An integer or decimal.</para>
          </description>
        </item>
      </list>
    </remarks>
  </Docs>
  <Members>
    <Member MemberName=".ctor">
      <MemberSignature Language="C#" Value="public StackLayout ();" />
      <MemberSignature Language="ILAsm" Value=".method public hidebysig specialname rtspecialname instance void .ctor() cil managed" />
      <MemberType>Constructor</MemberType>
      <AssemblyInfo>
        <AssemblyVersion>1.0.0.0</AssemblyVersion>
        <AssemblyVersion>1.1.0.0</AssemblyVersion>
        <AssemblyVersion>1.2.0.0</AssemblyVersion>
        <AssemblyVersion>1.3.0.0</AssemblyVersion>
        <AssemblyVersion>1.3.3.0</AssemblyVersion>
        <AssemblyVersion>1.4.0.0</AssemblyVersion>
        <AssemblyVersion>1.5.0.0</AssemblyVersion>
        <AssemblyVersion>2.0.0.0</AssemblyVersion>
      </AssemblyInfo>
      <Parameters />
      <Docs>
        <summary>Initializes a new instance of the StackLayout class.</summary>
        <remarks>
          <para>
              The following example shows the initialization of a new StackLayout and setting its orientation and children.
              </para>
          <example>
            <code lang="C#"><![CDATA[
var stackLayout = new StackLayout {
  Orientation = StackOrientation.Horizontal,
  Children = {
    firstChild,
    secondChild,
    thirdChild
  }
};
              ]]></code>
          </example>
        </remarks>
      </Docs>
    </Member>
    <Member MemberName="InvalidateMeasure">
      <MemberSignature Language="C#" Value="protected override void InvalidateMeasure ();" />
      <MemberSignature Language="ILAsm" Value=".method familyhidebysig virtual instance void InvalidateMeasure() cil managed" />
      <MemberType>Method</MemberType>
      <AssemblyInfo>
        <AssemblyVersion>1.3.3.0</AssemblyVersion>
        <AssemblyVersion>1.4.0.0</AssemblyVersion>
        <AssemblyVersion>1.5.0.0</AssemblyVersion>
      </AssemblyInfo>
      <ReturnValue>
        <ReturnType>System.Void</ReturnType>
      </ReturnValue>
      <Parameters />
      <Docs>
        <summary>Invalidates the layout.</summary>
        <remarks>To be added.</remarks>
      </Docs>
    </Member>
    <Member MemberName="LayoutChildren">
      <MemberSignature Language="C#" Value="protected override void LayoutChildren (double x, double y, double width, double height);" />
      <MemberSignature Language="ILAsm" Value=".method familyhidebysig virtual instance void LayoutChildren(float64 x, float64 y, float64 width, float64 height) cil managed" />
      <MemberType>Method</MemberType>
      <AssemblyInfo>
        <AssemblyVersion>1.0.0.0</AssemblyVersion>
        <AssemblyVersion>1.1.0.0</AssemblyVersion>
        <AssemblyVersion>1.2.0.0</AssemblyVersion>
        <AssemblyVersion>1.3.0.0</AssemblyVersion>
        <AssemblyVersion>1.3.3.0</AssemblyVersion>
        <AssemblyVersion>1.4.0.0</AssemblyVersion>
        <AssemblyVersion>1.5.0.0</AssemblyVersion>
        <AssemblyVersion>2.0.0.0</AssemblyVersion>
      </AssemblyInfo>
      <ReturnValue>
        <ReturnType>System.Void</ReturnType>
      </ReturnValue>
      <Parameters>
        <Parameter Name="x" Type="System.Double" />
        <Parameter Name="y" Type="System.Double" />
        <Parameter Name="width" Type="System.Double" />
        <Parameter Name="height" Type="System.Double" />
      </Parameters>
      <Docs>
        <param name="x">A value representing the x coordinate of the child region bounding box.</param>
        <param name="y">A value representing the y coordinate of the child region bounding box.</param>
        <param name="width">A value representing the width of the child region bounding box.</param>
        <param name="height">A value representing the height of the child region bounding box.</param>
        <summary>Positions and sizes the children of a StackLayout.</summary>
        <remarks>Implementors wishing to change the default behavior of a StackLayout should override this method. It is suggested to still call the base method and modify its calculated results.</remarks>
      </Docs>
    </Member>
    <Member MemberName="OnSizeRequest">
      <MemberSignature Language="C#" Value="protected override Xamarin.Forms.SizeRequest OnSizeRequest (double widthConstraint, double heightConstraint);" />
      <MemberSignature Language="ILAsm" Value=".method familyhidebysig virtual instance valuetype Xamarin.Forms.SizeRequest OnSizeRequest(float64 widthConstraint, float64 heightConstraint) cil managed" />
      <MemberType>Method</MemberType>
      <AssemblyInfo>
        <AssemblyVersion>1.0.0.0</AssemblyVersion>
        <AssemblyVersion>1.1.0.0</AssemblyVersion>
        <AssemblyVersion>1.2.0.0</AssemblyVersion>
        <AssemblyVersion>1.3.0.0</AssemblyVersion>
        <AssemblyVersion>1.3.3.0</AssemblyVersion>
        <AssemblyVersion>1.4.0.0</AssemblyVersion>
        <AssemblyVersion>1.5.0.0</AssemblyVersion>
        <AssemblyVersion>2.0.0.0</AssemblyVersion>
      </AssemblyInfo>
      <Attributes>
        <Attribute>
          <AttributeName>System.Obsolete("Use OnMeasure")</AttributeName>
        </Attribute>
      </Attributes>
      <ReturnValue>
        <ReturnType>Xamarin.Forms.SizeRequest</ReturnType>
      </ReturnValue>
      <Parameters>
        <Parameter Name="widthConstraint" Type="System.Double" />
        <Parameter Name="heightConstraint" Type="System.Double" />
      </Parameters>
      <Docs>
        <param name="widthConstraint">The available width for the StackLayout to use.</param>
        <param name="heightConstraint">The available height for the StackLayout to use.</param>
        <summary>This method is called during the measure pass of a layout cycle to get the desired size of the StackLayout.</summary>
        <returns>A <see cref="T:Xamarin.Forms.SizeRequest" /> which contains the desired size of the StackLayout.</returns>
        <remarks>The results of this method will be a sum of all the desired sizes of its children along the orientation axis, and the maximum along the non-orientation axis.</remarks>
      </Docs>
    </Member>
    <Member MemberName="Orientation">
      <MemberSignature Language="C#" Value="public Xamarin.Forms.StackOrientation Orientation { get; set; }" />
      <MemberSignature Language="ILAsm" Value=".property instance valuetype Xamarin.Forms.StackOrientation Orientation" />
      <MemberType>Property</MemberType>
      <AssemblyInfo>
        <AssemblyVersion>1.0.0.0</AssemblyVersion>
        <AssemblyVersion>1.1.0.0</AssemblyVersion>
        <AssemblyVersion>1.2.0.0</AssemblyVersion>
        <AssemblyVersion>1.3.0.0</AssemblyVersion>
        <AssemblyVersion>1.3.3.0</AssemblyVersion>
        <AssemblyVersion>1.4.0.0</AssemblyVersion>
        <AssemblyVersion>1.5.0.0</AssemblyVersion>
        <AssemblyVersion>2.0.0.0</AssemblyVersion>
      </AssemblyInfo>
      <ReturnValue>
        <ReturnType>Xamarin.Forms.StackOrientation</ReturnType>
      </ReturnValue>
      <Docs>
        <summary>Gets or sets the value which indicates the direction which child elements are positioned.</summary>
        <value>A <see cref="T:Xamarin.Forms.StackOrientation" /> which indicates the direction children layouts flow. The default value is Vertical.</value>
        <remarks>Setting the Orientation of a StackLayout triggers a layout cycle if the stack is already inside of a parent layout. To prevent wasted layout cycles, set the orientation prior to adding the StackLayout to a parent.</remarks>
      </Docs>
    </Member>
    <Member MemberName="OrientationProperty">
      <MemberSignature Language="C#" Value="public static readonly Xamarin.Forms.BindableProperty OrientationProperty;" />
      <MemberSignature Language="ILAsm" Value=".field public static initonly class Xamarin.Forms.BindableProperty OrientationProperty" />
      <MemberType>Field</MemberType>
      <AssemblyInfo>
        <AssemblyVersion>1.0.0.0</AssemblyVersion>
        <AssemblyVersion>1.1.0.0</AssemblyVersion>
        <AssemblyVersion>1.2.0.0</AssemblyVersion>
        <AssemblyVersion>1.3.0.0</AssemblyVersion>
        <AssemblyVersion>1.3.3.0</AssemblyVersion>
        <AssemblyVersion>1.4.0.0</AssemblyVersion>
        <AssemblyVersion>1.5.0.0</AssemblyVersion>
        <AssemblyVersion>2.0.0.0</AssemblyVersion>
      </AssemblyInfo>
      <ReturnValue>
        <ReturnType>Xamarin.Forms.BindableProperty</ReturnType>
      </ReturnValue>
      <Docs>
        <summary>Identifies the Orientation bindable property.</summary>
        <remarks>
        </remarks>
      </Docs>
    </Member>
    <Member MemberName="Spacing">
      <MemberSignature Language="C#" Value="public double Spacing { get; set; }" />
      <MemberSignature Language="ILAsm" Value=".property instance float64 Spacing" />
      <MemberType>Property</MemberType>
      <AssemblyInfo>
        <AssemblyVersion>1.0.0.0</AssemblyVersion>
        <AssemblyVersion>1.1.0.0</AssemblyVersion>
        <AssemblyVersion>1.2.0.0</AssemblyVersion>
        <AssemblyVersion>1.3.0.0</AssemblyVersion>
        <AssemblyVersion>1.3.3.0</AssemblyVersion>
        <AssemblyVersion>1.4.0.0</AssemblyVersion>
        <AssemblyVersion>1.5.0.0</AssemblyVersion>
        <AssemblyVersion>2.0.0.0</AssemblyVersion>
      </AssemblyInfo>
      <ReturnValue>
        <ReturnType>System.Double</ReturnType>
      </ReturnValue>
      <Docs>
        <summary>Gets or sets a value which indicates the amount of space between each child element.</summary>
        <value>A value in device pixels which indicates the amount of space between each element. The default value is 6.0.</value>
        <remarks>
          <para>
            Setting this value triggers a layout cycle if the StackLayout is already in a parent Layout.
          </para>
          <para>
              The following example sets the Spacing on construction of a StackLayout.
              </para>
          <example>
            <code lang="C#"><![CDATA[
var stackLayout = new StackLayout {
  Spacing = 10
};
              ]]></code>
          </example>
        </remarks>
      </Docs>
    </Member>
    <Member MemberName="SpacingProperty">
      <MemberSignature Language="C#" Value="public static readonly Xamarin.Forms.BindableProperty SpacingProperty;" />
      <MemberSignature Language="ILAsm" Value=".field public static initonly class Xamarin.Forms.BindableProperty SpacingProperty" />
      <MemberType>Field</MemberType>
      <AssemblyInfo>
        <AssemblyVersion>1.0.0.0</AssemblyVersion>
        <AssemblyVersion>1.1.0.0</AssemblyVersion>
        <AssemblyVersion>1.2.0.0</AssemblyVersion>
        <AssemblyVersion>1.3.0.0</AssemblyVersion>
        <AssemblyVersion>1.3.3.0</AssemblyVersion>
        <AssemblyVersion>1.4.0.0</AssemblyVersion>
        <AssemblyVersion>1.5.0.0</AssemblyVersion>
        <AssemblyVersion>2.0.0.0</AssemblyVersion>
      </AssemblyInfo>
      <ReturnValue>
        <ReturnType>Xamarin.Forms.BindableProperty</ReturnType>
      </ReturnValue>
      <Docs>
        <summary>Identifies the Spacing bindable property.</summary>
        <remarks>
        </remarks>
      </Docs>
    </Member>
  </Members>
</Type>