Skip to content

Instantly share code, notes, and snippets.

@matsukurou
Created June 21, 2015 07:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save matsukurou/06111881313e8b3e8ed7 to your computer and use it in GitHub Desktop.
Save matsukurou/06111881313e8b3e8ed7 to your computer and use it in GitHub Desktop.
Xamarin.Forms で画像を表示する
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