コード例 #1
0
		protected override void OnCreate (Bundle bundle)
		{
			base.OnCreate (bundle);

			SetContentView (Resource.Layout.NewMain);

			var layout = FindViewById<LinearLayout> (Resource.Id.mainLayout);
			var blackbirdImage = new MyImageView (this) {};

			blackbirdImage.SetImageResource (Resource.Drawable.blackbird);
			layout.AddView (blackbirdImage);

			var removeImageButton = FindViewById<Button> (Resource.Id.removeImageButton);

			removeImageButton.Click += (sender, e) => {
				ViewGroup parent = (ViewGroup)blackbirdImage.Parent;
				parent.RemoveView (blackbirdImage);

				//TODO : Demo 2 - Step 1
				//blackbirdImage.Dispose();
			};
		}
コード例 #2
0
        protected override void OnCreate(Bundle bundle)
        {
            base.OnCreate(bundle);

            SetContentView(Resource.Layout.NewMain);

            var layout         = FindViewById <LinearLayout> (Resource.Id.mainLayout);
            var blackbirdImage = new MyImageView(this)
            {
            };

            blackbirdImage.SetImageResource(Resource.Drawable.blackbird);
            layout.AddView(blackbirdImage);

            var removeImageButton = FindViewById <Button> (Resource.Id.removeImageButton);

            removeImageButton.Click += (sender, e) => {
                ViewGroup parent = (ViewGroup)blackbirdImage.Parent;
                parent.RemoveView(blackbirdImage);

                //TODO : Demo 2 - Step 1
                //blackbirdImage.Dispose();
            };
        }