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
|
using System;
using Xamarin.Forms.CustomAttributes;
namespace Xamarin.Forms.Controls
{
[Preserve (AllMembers=true)]
[Issue (IssueTracker.Github, 1384, "Image is grid issue", PlatformAffected.Android | PlatformAffected.iOS | PlatformAffected.WinPhone)]
public class Issue1384:ContentPage
{
public Issue1384 ()
{
var grid = new Grid {BackgroundColor = Color.Red, VerticalOptions=LayoutOptions.Start};
grid.Children.Add (new Image {Source = "photo.jpg", Aspect = Aspect.AspectFit});
grid.Children.Add (new Label {
Opacity =.75,
#pragma warning disable 618
YAlign = TextAlignment.Start,
#pragma warning restore 618
#pragma warning disable 618
XAlign = TextAlignment.End,
#pragma warning restore 618
Text ="top and flush right",
#pragma warning disable 618
Font = Font.SystemFontOfSize (NamedSize.Large),
#pragma warning restore 618
VerticalOptions=LayoutOptions.Start,
HorizontalOptions=LayoutOptions.End,
HeightRequest=30,
TextColor = Color.White
});
grid.Children.Add (new Label {
Opacity =.75,
#pragma warning disable 618
YAlign = TextAlignment.End,
#pragma warning restore 618
Text ="bottom and flush left",
#pragma warning disable 618
Font = Font.SystemFontOfSize (NamedSize.Large),
#pragma warning restore 618
VerticalOptions=LayoutOptions.End,
HeightRequest=40,
TextColor = Color.White,
BackgroundColor = Color.Green,
});
Content = grid;
}
}
}
|