本文整理汇总了C#中ImageView.SetMaxWidth方法的典型用法代码示例。如果您正苦于以下问题:C# ImageView.SetMaxWidth方法的具体用法?C# ImageView.SetMaxWidth怎么用?C# ImageView.SetMaxWidth使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ImageView
的用法示例。
在下文中一共展示了ImageView.SetMaxWidth方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ImageZoom
//-----------clicking on images -> image on fullscreen---------//
protected void ImageZoom(ImageView imageView, string Tag, LinearLayout fullScreen, LinearLayout downScreen, Button takeIt)
{
imageView.Click += ((object sender, System.EventArgs e) => {
Log.Info(Tag, "isImageFitToScreen: " + isImageFitToScreen.ToString());
if (isImageFitToScreen) {
downScreen.RemoveView(imageView);
imageView.SetMaxHeight (1500);
imageView.SetMaxWidth (1500);
fullScreen.AddView(imageView);
fullScreen.AddView(takeIt);
Log.Info(Tag, "maximize");
canBeSelected = true;
isImageFitToScreen = false;
} else {
fullScreen.RemoveView(takeIt);
fullScreen.RemoveView(imageView);
imageView.SetMaxHeight (450);
imageView.SetMaxWidth (450);
downScreen.AddView(imageView);
Log.Info(Tag, "minimize");
canBeSelected = false;
isImageFitToScreen = true;
}
});
}
示例2: Initialize
private void Initialize()
{
ImageView logo = new ImageView(Context) { Id = 0x0fffff2a };
logo.SetImageResource(Resource.Drawable.logo);
logo.SetAdjustViewBounds(true);
logo.SetMinimumHeight(60);
logo.SetMaxHeight(60);
_imageCategoryView = new ImageView(Context);
_imageCategoryView.SetAdjustViewBounds(true);
_imageCategoryView.SetMinimumHeight(60);
_imageCategoryView.SetMaxHeight(60);
_imageCategoryView.Id = 0x0fffff2b;
_imageCategoryView.SetMinimumWidth(60);
_imageCategoryView.SetMaxWidth(60);
_imageCategoryView.Measure(60, 60);
_textCategoryView = new TextView(Context);
_textCategoryView.SetMaxHeight(60);
_textCategoryView.SetTextColor(Color.Black);
_textCategoryView.Id = 0x0fffff2c;
_textCategoryView.SetTextSize(ComplexUnitType.Sp, 15);
_textCategoryView.Gravity = GravityFlags.CenterVertical;
LayoutParams lp = new LayoutParams(ViewGroup.LayoutParams.WrapContent, ViewGroup.LayoutParams.WrapContent);
lp.AddRule(LayoutRules.AlignParentRight);
lp.AddRule(LayoutRules.CenterVertical);
AddView(logo, lp);
lp = new LayoutParams(ViewGroup.LayoutParams.WrapContent, ViewGroup.LayoutParams.WrapContent);
lp.AddRule(LayoutRules.AlignParentLeft);
lp.AddRule(LayoutRules.CenterVertical);
AddView(_imageCategoryView, lp);
lp = new LayoutParams(ViewGroup.LayoutParams.WrapContent, ViewGroup.LayoutParams.WrapContent);
lp.AddRule(LayoutRules.RightOf, _imageCategoryView.Id);
lp.AddRule(LayoutRules.CenterVertical);
lp.SetMargins(60, 0, 60, 0);
AddView(_textCategoryView, lp);
}
示例3: ini
public void ini(){
var textFormat = Android.Util.ComplexUnitType.Px;
var textFormatdip = Android.Util.ComplexUnitType.Dip;
mainLayout = new RelativeLayout (context);
mainLayout.LayoutParameters = new RelativeLayout.LayoutParams (-1,-1);
mainLinearLayout = new LinearLayout (context);
headerLinearLayout = new LinearLayout (context);
contentLinearLayout = new LinearLayout (context);
mainHeaderLinearLayout = new LinearLayout (context);
imHeader = new ImageView (context);
titleHeader = new TextView (context);
AutorHeader = new TextView (context);
content = new TextView (context);
titleHeader.Typeface = Typeface.CreateFromAsset(context.Assets, "fonts/HelveticaNeue.ttf");
AutorHeader.Typeface = Typeface.CreateFromAsset(context.Assets, "fonts/HelveticaNeue.ttf");
content.Typeface = Typeface.CreateFromAsset(context.Assets, "fonts/HelveticaNeue.ttf");
mainLinearLayout.LayoutParameters = new LinearLayout.LayoutParams (-1, -2);
mainHeaderLinearLayout.LayoutParameters = new LinearLayout.LayoutParams (-1, Configuration.getHeight(125));
contentLinearLayout.LayoutParameters = new LinearLayout.LayoutParams (-1, -2);
headerLinearLayout.LayoutParameters = new LinearLayout.LayoutParams (-1, -1);
mainLinearLayout.Orientation = Orientation.Vertical;
mainHeaderLinearLayout.Orientation = Orientation.Horizontal;
headerLinearLayout.Orientation = Orientation.Vertical;
contentLinearLayout.Orientation = Orientation.Vertical;
mainLinearLayout.AddView (mainHeaderLinearLayout);
mainLinearLayout.AddView (contentLinearLayout);
mainHeaderLinearLayout.AddView (imHeader);
mainHeaderLinearLayout.AddView (headerLinearLayout);
headerLinearLayout.AddView (titleHeader);
headerLinearLayout.AddView (AutorHeader);
headerLinearLayout.SetPadding (15, 0, 0, 10);
AutorHeader.SetPadding (0, 15, 0, 0);
contentLinearLayout.AddView (content);
contentLinearLayout.SetPadding (0, 15, 0, 0);
mainLinearLayout.SetBackgroundResource (Resource.Drawable.border);
// mainLinearLayout.SetX (Configuration.getHeight (45));
//mainLinearLayout.SetY (Configuration.getWidth (500));
//titleHeader.Text = "Diferentes tipos de aves en Perú";
titleHeader.SetTextColor (Color.ParseColor ("#FF0080"));
//titleHeader.SetTextSize (textFormat, Configuration.getHeight (38));
titleHeader.SetTextSize (textFormatdip, 16.0f);
titleHeader.SetMaxWidth (Configuration.getWidth (274));
titleHeader.SetMaxHeight (Configuration.getHeight (80));
//titleHeader.SetX (Configuration.getHeight (218));titleHeader.SetY (Configuration.getWidth (794-desviacion));
titleHeader.Ellipsize = TextUtils.TruncateAt.End;
titleHeader.SetMaxLines(2);
//AutorHeader.Text = "Autor del Articulo";
AutorHeader.SetTextColor(Color.ParseColor ("#424242"));
AutorHeader.SetTextSize (textFormat, Configuration.getHeight (23));
AutorHeader.SetMaxWidth (Configuration.getWidth (274));
//AutorHeader.SetMaxHeight (Configuration.getHeight (25));
//AutorHeader.SetX (Configuration.getHeight (218));AutorHeader.SetY (Configuration.getWidth (895-desviacion));
AutorHeader.Ellipsize = TextUtils.TruncateAt.End;
AutorHeader.SetMaxLines(1);
//content.Text = "Los factores geográficos, climáticos y evolutivos convierten al Perú en el mejor lugar para realizar la observacion de aves(birthwaching) Tiene 1830 especies de";
//content.SetTextSize (textFormat, Configuration.getHeight (24));
content.SetTextSize (textFormatdip, 12.0f);
content.SetMaxWidth (Configuration.getWidth(501));
//content.SetX (Configuration.getHeight (68));content.SetY (Configuration.getWidth (951-desviacion));
//content.Ellipsize = TextUtils.TruncateAt.End;
//content.SetMaxLines(4);
//imHeader.SetImageBitmap (Bitmap.CreateScaledBitmap (getBitmapFromAsset("icons/user.png"),Configuration.getWidth (124), Configuration.getHeight (124),true));
//imHeader.SetX (Configuration.getHeight (68));imHeader.SetY (Configuration.getWidth (792-desviacion));
imHeader.SetMaxWidth (Configuration.getWidth (124));
imHeader.SetMaxHeight (Configuration.getWidth (124));
int padW = Configuration.getWidth(45);
int padH = Configuration.getHeight (15);
mainLayout.SetPadding (padW,padH,padW,padH);
//.........这里部分代码省略.........
示例4: clickingImage
//----------image is clicked and color filter is set---------//
private void clickingImage(ImageView imageView, Button takeIt, LinearLayout fullScreen, LinearLayout downScreen)
{
// TODO: If one image is zoomed in multiple times, this function is also executed this amount of times.
// This function should only be executed one time no matter what.
takeIt.Click += ((object sender, System.EventArgs e) => {
Log.Info(Tag, "takeIt Button: " + takeIt.ToString());
if(isSelected && canBeSelected) {
if(imagesSelected < 1) {
imagesSelected += 1;
}
if (takeIt == takeItFirst) {
imageView.SetImageResource(Resource.Drawable.InDieBerge_confirmed);
}
if (takeIt == takeItSecond) {
imageView.SetImageResource(Resource.Drawable.InDenBusch_confirmed);
}
if (takeIt == takeItThird) {
imageView.SetImageResource(Resource.Drawable.InDieCity_confirmed);
}
if (takeIt == takeItFourth) {
imageView.SetImageResource(Resource.Drawable.AnDenStrand_confirmed);
}
Log.Info(Tag, "Images Selected: " + imagesSelected.ToString());
if(choosenImage != imageView) {
choosenImage = imageView;
} else {
choosenImage = null;
}
definingTag(imageView, true);
isSelected = false;
fullScreen.RemoveView(takeIt);
fullScreen.RemoveView(imageView);
imageView.SetMaxHeight (450);
imageView.SetMaxWidth (450);
downScreen.AddView(imageView);
Log.Info(Tag, "minimize");
canBeSelected = false;
isImageFitToScreen = true;
} else if (!isSelected && canBeSelected){
if(imagesSelected > 0) {
imagesSelected -= 1;
}
if (takeIt == takeItFirst) {
imageView.SetImageResource(Resource.Drawable.InDieBerge);
}
if (takeIt == takeItSecond) {
imageView.SetImageResource(Resource.Drawable.InDenBusch);
}
if (takeIt == takeItThird) {
imageView.SetImageResource(Resource.Drawable.InDieCity);
}
if (takeIt == takeItFourth) {
imageView.SetImageResource(Resource.Drawable.AnDenStrand);
}
Log.Info(Tag, "Images Selected: " + imagesSelected.ToString());
definingTag(imageView, false);
isSelected = true;
}
if (choosenImage != null) {
Log.Info(Tag, "choosenImage: " + choosenImage.ToString());
} else {
Log.Info(Tag, "choosen Image: null");
}
Log.Info(Tag, "isSelected: " + isSelected.ToString());
});
}
示例5: ImageZoom
//-----------clicking on images -> image on fullscreen---------//
protected void ImageZoom(ImageView imageView, string Tag, LinearLayout fullScreen, LinearLayout downScreen, Button takeIt)
{
imageView.Click += ((object sender, System.EventArgs e) => {
if(phase == 1) {
Log.Info(Tag, "isImageFitToScreen: " + isImageFitToScreen.ToString());
if (isImageFitToScreen) {
downScreen.RemoveView(imageView);
imageView.SetMaxHeight (1500);
imageView.SetMaxWidth (1500);
fullScreen.AddView(imageView);
fullScreen.AddView(takeIt);
Log.Info(Tag, "maximize");
clickingImage(imageView, takeIt);
isImageFitToScreen = false;
} else {
fullScreen.RemoveView(takeIt);
fullScreen.RemoveView(imageView);
imageView.SetMaxHeight (450);
imageView.SetMaxWidth (450);
downScreen.AddView(imageView);
Log.Info(Tag, "minimize");
isImageFitToScreen = true;
isSelected = true;
}
}
if(phase == 2) {
if(isImageChoosen) {
if (imageView == firstPersonImage) {
imageView.SetImageResource(Resource.Drawable.test_test);
}
else if (imageView == secondPersonImage) {
}
else if (imageView == thirdPersonImage) {
}
else if (imageView == fourthPersonImage) {
}
isImageChoosen = false;
if(imagesSelected < 1) {
imagesSelected += 1;
phase = 3;
}
Log.Info(Tag, "Image Choosen" + imagesSelected.ToString());
definingTag(imageView, true);
} else {
if (imageView == firstPersonImage) {
imageView.SetImageResource(Resource.Drawable.test);
}
else if (imageView == secondPersonImage) {
}
else if (imageView == thirdPersonImage) {
}
else if (imageView == fourthPersonImage) {
}
if(imagesSelected > 0) {
imagesSelected -= 1;
phase = 2;
}
isImageChoosen = true;
Log.Info(Tag, "Image De-Choosen" + imagesSelected.ToString());
}
}
});
}