Created
June 21, 2015 07:06
-
-
Save matsukurou/06111881313e8b3e8ed7 to your computer and use it in GitHub Desktop.
Xamarin.Forms で画像を表示する
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class ImagePage : ContentPage | |
{ | |
public ImagePage() | |
{ | |
// Imageビューの生成 | |
var image = new Image | |
{ | |
// 画像を読み込んでSourceプロパティに設定 | |
Source = ImageSource.FromResource("ImageSample.Resources.Images.button_leftArrow.png"), | |
}; | |
Content = new StackLayout | |
{ | |
// 画面中央からレイアウト | |
VerticalOptions = LayoutOptions.Center, | |
Children = | |
{ | |
image, | |
} | |
}; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment