Created
June 28, 2014 18:08
-
-
Save rmarinho/1ad6979cb5dd899a03df to your computer and use it in GitHub Desktop.
align image on center
This file contains hidden or 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
if(string.IsNullOrEmpty(imageButton.Text)) | |
{ | |
SetImage(imageButton.Image, imageButton.ImageWidthRequest, imageButton.ImageHeightRequest, targetButton); | |
} | |
else | |
{ | |
SetImage(imageButton.Image, imageButton.ImageWidthRequest, imageButton.ImageHeightRequest, targetButton); | |
switch (imageButton.Orientation) { | |
case ImageOrientation.ImageToLeft: | |
AlignToLeft (targetButton); | |
break; | |
case ImageOrientation.ImageToRight: | |
AlignToRight (imageButton.ImageWidthRequest, targetButton); | |
break; | |
case ImageOrientation.ImageOnTop: | |
AlignToTop (imageButton.ImageHeightRequest, imageButton.ImageWidthRequest, targetButton); | |
break; | |
case ImageOrientation.ImageOnBottom: | |
AlignToBottom (imageButton.ImageHeightRequest, imageButton.ImageWidthRequest, targetButton); | |
break; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment